# -*- coding: utf-8 -*-
N = int(input())
a_list = list(map(int, input().split()))
ans = "No"
a_list.sort()
a_list.insert(0, a_list[-1])
a_list.append(a_list[1])
for i in range(1, N + 1):
    if a_list[i-1] ^ a_list[i+1] != a_list[i]:
        break
else:
    ans = "Yes"
print(ans)