for _ in range(int(input())): n = int(input()); s = input(); ans = "No" for i in range(4): dp = [[False]*4 for _ in range(n)]; dp[1][i] = True for j in range(2,n): if s[j]!="1" and dp[j-1][2]: dp[j][0] = True if s[j]!="0" and dp[-1][0]+dp[-1][2]: dp[j][1] = True if s[j]!="1" and dp[-1][1]+dp[-1][3]: dp[j][2] = True if s[j]!="0" and dp[j-1][1]: dp[j][3] = True if i==0 and dp[-1][1]+dp[-1][3]: ans = "Yes" if i==1 and sum(dp[-1][1:]): ans = "Yes" if i==2 and sum(dp[-1][:3]): ans = "Yes" if i==3 and dp[-1][0]+dp[-1][2]: ans = "Yes" print(ans)