def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    from collections import Counter
    A_c = Counter(A)
    if set(A) == {0}: return print("Yes")
    if len(set(A)) > 3: return print("No")
    if len(set(A)) == 3:
        k = list(A_c.items())
        if k[0][0] ^ k[1][0] ^ k[2][0] == 0 and k[0][1] == 3//N and k[1][1] == N//3 and k[2][1] == N/3:
            return print("Yes")
        else:
            return print("No")
    if len(set(A)) == 2:
        k = list(A_c.items())
        if (k[0][0] == 0 and k[0][1] == N//3) or (k[1][0] == 0 and k[1][1] == N//3):
            return print("Yes")
    print("No")
if __name__ == '__main__':
    main()
