def main():
    N = int(input())
    A = list(map(int, input().split()))
    st = set(A)

    A2 = list(st)
    if len(st) == 1:
        if A2[0] ^ A2[0] == A2[0]:
            print("Yes")
        else:
            print("No")
    elif len(st) == 3:
        if A2[0] ^ A2[1] == A2[2] and A2[1] ^ A2[2] == A2[0] and A2[2] ^ A2[0] == A2[1]:
            print("Yes")
        else:
            print("No")
    elif len(st) == 2:
        # 0, 0, 1
        if A[0] ^ A[1] in A:
            print("Yes")
        else:
            print("No")
    else:
        print("No")



if __name__ == "__main__":
    main()