```
def sg(x):
global m
if f[x] != -1 :return f[x]
S = []
for i in range(m):
sum = s[i]
if x >= sum : S.append(sg(x-sum))
i = 0
while True:
if i not in S:
f[x] = i
return f[x]
i+=1
if name==’main’:
M = 10010
m = int(input())
s = list(map(int,input().split()))
n = int(input())
p = list(map(int,input().split()))
f = [-1]*M
res = 0
for i in range(n):
res ^= sg(p[i])
print('Yes' if res else 'No')
```