import numpy as np
N = int(raw_input())
a = map(int,raw_input().split(" "))
tmp = 1
for i in range(N-1):
	tmp *= a[i] * a[i+1]

if tmp % pow(4,N-1) == 0 and tmp >= pow(4,N-1):
	print "Yes"
else:
	print "No"