def main():
	N = int(input())
	A = list(map(int, input().split()))
	if N != 3:
		print("No")
		return

	val_set = set()
	c = (A[0]>>2)<<2
	possible = True
	for a in A:
		tmp = a
		add_val = tmp&1
		add_val |= ((tmp>>1)&1)<<1
		cur = (tmp>>2)<<2
		if c != cur:
			possible = False
		val_set.add(add_val)
	if not possible:
		print("No")
		return

	possible = False
	ans_arr = [[1, 2, 3], [0, 1, 3], [0, 2, 3], [0, 1, 2]]
	for arr in ans_arr:
		this_ans = True
		for a in arr:
			if not a in val_set:
				this_ans = False
		if this_ans:
			possible = True
			break
	if possible:
		print("Yes")
	else:
		print("No")


if __name__ == '__main__':
	main()