#include #include #include using namespace std; int main() { int n; string s; cin >> n >> s; if (n < 2 || s == "101" || "010") { cout << "NO" << endl; } else{ cout << "YES" << endl; } return 0; }