n=int(input()) a=list(map(int,input().split())) if 0 in a or 1 in a: print("Yes") else: print("No")