#include<stdio.h> int main(){ int n,x,tol; scanf("%d",&n); tol=0; while(n--) { scanf("%d",&x); if(x==1) tol=tol+1; } if(tol!=0) printf("YES"); else printf("NO"); }