n = 2**int(input()) a = [int(input()) for _ in range(n)] b = [i%2 for i in range(n)] print("Yes" if a==b else "No")