input() A=list(map(int,input().split())) print("YNeos"[A.count(0)==A.count(1)==0::2])