#include #include #include #define rep(i,n) for(int i=0; i> N >> S; int l = S.length(); if (l == 1) { cout << "NO" << endl; } else if (l == 2) { if (S == "00" || S == "11") cout << "YES" << endl; else cout << "NO" << endl; } else if (l == 3) { if (S == "101" || S == "010") cout << "NO" << endl; else cout << "YES" << endl; } else { cout << "YES" << endl; } return 0; }