n = int(input())
a = list(map(int,input().split()))

if (a[1] ^ a[-1]) != a[0]:
    
    for i in range(1,n-2):
        if (a[i-1] ^ a[i+1]) != a[i]:
            continue
        
        else:
            print('Yes')
            exit()
    
    
    if (a[0] ^ a[-2]) != a[-1]:
        print('No')
        exit()
    
    else:
        print('Yes')
        exit()

else:
    print('Yes')