# -*- coding: utf-8 -*-
def main():
    N = int(input())
    a = list(map(int, input().split()))
    for i in range(1, N-1, 1):
        if not a[i-1] ^ a[i+1] == a[i]:
            print("No")
            exit()

    if not a[N-1] ^ a[1] == a[0]:
        print("No")
        exit()
    elif not a[N-2] ^ a[0]  == a[N-1]:
        print("No")
        exit()
    print("Yes")


if __name__ == '__main__':
    main()