T = int(input()) for i in range(T): N = int(input()) S = input() count0 = 0 count1 = 0 result = 'Yes' for l in range(N+2): if l >= N : l -= N ls = S[l] if ls == '0': count0 += 1 count1 = 0 elif ls == '1': count1 += 1 count0 = 0 else: if count1 == 2: count0 += 1 count1 = 0 elif count0 == 2: count1 += 1 count0 = 0 else: laf = l+1 if laf >= N: laf = l +1 - N if S[laf] == '1': count0 += 1 count1 = 0 elif S[laf] == '0': count1 += 1 count0 = 0 else: lafaf = laf+1 if lafaf >= N: lafaf = laf + 1 - N if S[lafaf] == '1': count0 += 1 count1 = 0 elif S[lafaf] == '0': count1 += 1 count0 = 0 if count0 == 3 or count1 == 3: result = 'No' print(result)