N = int(input())
a = list(map(int, input().split()))
a.sort()

def main():
    if a[0] != 0 and a[0] != a[-1] ^ a[1]:
        print("No")
        return
    for i in range(1, N - 1):
        if a[i] == 0:
            continue
        if a[i] != a[i + 1] ^ a[i - 1]:
            print("No")
            return
    if a[-1] != a[0] ^ a[-2]:
        print("No")
        return
    print("Yes")

main()