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