#include using namespace std; using ll = long long; int T, n; string s; int f[2][2], g[2][2]; bool ok(int a, int b){ for(int i=0; i<2; ++i){ for(int j=0; j<2; ++j) f[i][j] = g[i][j] = 0; } f[a][b] = 1; for(int i=2; i> T; while(T--){ cin >> n >> s; if(ok()){ cout << "Yes\n"; } else { cout << "No\n"; } } return 0; }