#include using namespace std; int main() { int n; cin>>n; int a=0, b=0; while (n--) { char t; cin>>t; (t=='0' ? a : b)++; } cout<<(a>1 or b>1 ? "YES" : "NO")<