import math
import collections
N = int(input())
A = [int(i) for i in input().split()]

def trial_division(n):
    Num = n
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割っていく
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            factor.append(num)
    #リストが空ならそれは素数
    if not factor:
        return [Num]
    else:
        factor.append(n)
        return factor


List = [[] for i in range(N)]
for i in range(N):
    tmp = trial_division(A[i])
    tmp = collections.Counter(tmp)
    List[i] = tmp[2]

cnt0,cnt1,cnt2 = 0,0,0
for i in range(len(List)):
    if List[i]==1 and List[i+1]!=1:
        cnt0 += 1

    if List[i]==0:
        cnt0+=1
        
    elif List[i]==1:
        cnt1+=1
        
    else:
        cnt2 += 1
        


if cnt2+1>=cnt0:
    print('Yes')
else:
    print('No')

