import sys
fl = input()
sl = input()
fnumofel = int(len(fl)) - int("1")
int(fnumofel)
slist = sl.split(" ")
statlist = []
n = 0
for v in slist:
	int(n)
	if n == 0 or n == fnumofel:
		if n == 0:
			nextnum = slist[1]
			prevnum = slist[-1]
			currnum = slist[0]
			xored = int(prevnum) ^ int(nextnum)
			if int(xored) == int(currnum):
				pass
			else:
				print("No")
				sys.exit()
		elif n == fnumofel:
			nextnum = slist[0]
			prevnum = slist[fnumofel]
			currnum = slist[n]
			xored = int(prevnum) ^ int(nextnum)
			if int(xored) == int(currnum):
				pass
			else:
				print("No")
				sys.exit()
		else:
			nntmp = n + 1
			pntmp = n - 1
			nextnum = slist[nntmp]
			prevnum = slist[pntmp]
			currnum = slist[n]
			xored = int(prevnum) ^ int(nextnum)
			if int(xored) == int(currnum):
				pass
			else:
				print("No")
				sys.exit()
		n+=1
print("Yes")
