def main():
    N = int(input())
    array = list(map(int, input().split()))
    set_array = list(set(array))
    if len(set_array) == 1 and set_array[0] == 0:
        return "Yes"
    if N != len(array):
        return "No"
    if N%3 != 0:
        return "No"
    if len(set_array) != 3:
        return "No"
    for i in range(2):
        if array.count(set_array[i]) != array.count(set_array[i+1]):
            return "No"
    x = set_array[0]
    y = set_array[1]
    z = set_array[2]
    if x ^ y == z and y ^ z == x and x ^ z == y:
        return "Yes" 
    return "No"

print(main())