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

    A2 = list(st)
    if len(st) == 1 and st.pop() == 0:
        print("Yes")
    elif len(st) != 3:
        print("No")
    elif 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")



if __name__ == "__main__":
    main()