from collections import Counter

def main():
    N = int(input())
    A = tuple(map(int, input().split()))
    
    c = Counter(A)
    values = list(c.values())
    keys = list(map(int, c.keys()))

    if len(keys) == 3 and keys[0] ^ keys[1] == keys[2] and values[0] == values[1] and values[1] == values[2]:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()