Harryxun/stf_run huggingface dataset:
MOD = 10**9 + 7
X, Y = map(int, input().split())


def f(n):
    res = n
    for i in range(1, n):
        res *= i
        res %= MOD
    return res


def solve():
    ans = 0
    if (X + Y) % 3 == 0:
        n = (2 * X - Y) // 3
        m = (2 * Y - X) // 3
    if n > 0 and m > 0:
        ans += (f(n + m) * pow(f(n), MOD - 2, MOD) * pow(f(m), MOD - 2, MOD)) % MOD

    print(ans)


if __name__ == "__main__":
    solve()

### FIXED CODE ###

MOD = 10**9 + 7
X, Y = map(int, input().split())


def f(n):
    res = n
    for i in range(1, n):
        res *= i
        res %= MOD
    return res


def solve():
    ans = 0
    if (X + Y) % 3 == 0:
        n = (2 * X - Y) // 3
        m = (2 * Y - X) // 3
        if n == 0 or m == 0:
            ans += 1
        elif n > 0 and m > 0:
            ans += (f(n + m) * pow(f(n), MOD - 2, MOD) * pow(f(m), MOD - 2, MOD)) % MOD

    print(ans)


if __name__ == "__main__":
    solve()
import math

a,b,c,d = map(int,input().split())
cd =  int(c*d/math.gcd(c, d))

ac1,ac2 = a//c,a%c
ad1,ad2 = a//d,a%d
bc1,bc2 = b//c,b%c
bd1,bd2 = b//d,b%d
acd1,acd2 = a//cd,a%cd
bcd1,bcd2 = b//cd,b%cd

if ac2 == 0:
    a_ = bc1-ac1+1
else:
    a_ = bc1-ac1

if ad2 == 0:
    b_ = bd1-ad1+1
else:
    b_ = bd1-ad1

if acd2 == 0:
    c_ = bcd1-acd1+1
else:
    c_ = bcd1-acd1

print(b-a+1-(a_+b_-c_))




### FIXED CODE ###

import fractions

a,b,c,d = map(int,input().split())
cd =  int(c*d/fractions.gcd(c, d))

ac1,ac2 = a//c,a%c
ad1,ad2 = a//d,a%d
bc1,bc2 = b//c,b%c
bd1,bd2 = b//d,b%d
acd1,acd2 = a//cd,a%cd
bcd1,bcd2 = b//cd,b%cd

if ac2 == 0:
    a_ = bc1-ac1+1
else:
    a_ = bc1-ac1

if ad2 == 0:
    b_ = bd1-ad1+1
else:
    b_ = bd1-ad1

if acd2 == 0:
    c_ = bcd1-acd1+1
else:
    c_ = bcd1-acd1

print(b-a+1-(a_+b_-c_))
a, b = [int(i) for i in input().split()]
small = min(a, b)
big = max(a, b)

import sys

if small == 1:
    print(1)
    sys.exit(0)

import math

prime_flag = [True] * (small + 1)
limit  = int(math.sqrt(small))
#for i in range(2, limit + 2):
#    if not prime_flag[i]:
#        continue
#    for j in range(i + i, small + 1, i):
#        prime_flag[j] = False

#primes = [i for i, _ in enumerate(prime_flag) if prime_flag[i]][2:]
#cd = [p for p in primes if (small % p == 0) and (big % p == 0)]
#
#print(len(cd) + 1)


### FIXED CODE ###

a, b = [int(i) for i in input().split()]
small = min(a, b)
big = max(a, b)

import sys

if small == 1:
    print(1)
    sys.exit(0)

import math
import collections

# FYI: https://ja.wikipedia.org/wiki/%E8%A9%A6%E3%81%97%E5%89%B2%E3%82%8A%E6%B3%95
def prime_factorization(num, divisors=None):
    if num <= 1:
        assert False
    factors = []

    # divisorsを使い回せるようにする。
    #   - 二度生成した場合にかかる時間が許容できない場合
    #   - エラトステネスの篩などで素数テーブルを既に持っている場合
    if not divisors:
        divisors = [2] + [i for i in range(3, int(math.sqrt(num)) + 1) if i % 2 != 0]

    for d in divisors:
        # divisorsを引数で与えた場合のみ起こりうる
        if num < d:
            break
        while num % d == 0:
            factors.append(d)
            num //= d

    if num != 1:
        factors.append(num)
    return factors

divisors = [2] + [i for i in range(3, int(math.sqrt(big)) + 1) if i % 2 != 0]
small_factors = set(prime_factorization(small, divisors))
big_factors = set(prime_factorization(big, divisors))

print(len(small_factors.intersection(big_factors)) + 1)
N = int(input())
A = list(map(int, input().split()))
A2 = []
Z = []
ans = 0
zerocnt = 0
for ai in A:
    if ai == 0:
        zerocnt += 1
    elif zerocnt >= 1:
        A2 += [0]
        Z += [zerocnt]
        ans += (zerocnt * (zerocnt+1)) // 2
        zerocnt = 0
    if ai != 0:
        A2 += [ai]
        Z += [1]
        ans += 1

if zerocnt >= 1:
    A2 += [0]
    Z += [zerocnt]
    ans += (zerocnt * (zerocnt+1)) // 2
    zerocnt = 0

for i, ai in enumerate(A2):
    aixor = ai
    sumA = ai
    for j in range(i+1, min(i+41, len(A2))):
        aj = A2[j]
        aixor = aixor ^ aj
        sumA += aj
        if aixor != sumA:
            break
        else:
            ans += (Z[i] * Z[j])
        
print(ans)

### FIXED CODE ###

a, b = map(int, input().split())
ans = max(a+b, a-b)
ans = max(ans, a*b)
print(ans)
l=input()
mod=pow(10,9)+7

def func(li):
  if '0' not in li:
    return pow(3,len(li),mod)
  if len(li)==1:
    if li=='1':
      return 3
    else:
      return 1
  if li[0]=='0':
    return func(li[1:])
  else:
    ret=(2*func(li[1:]))%mod
    ret+=func('1'*(len(li)-1))
    return ret%mod
print(func(l))


### FIXED CODE ###

l=input()
n=len(l)
mod=pow(10,9)+7
import sys
sys.setrecursionlimit(10**7)
#dp1,dp2=[0]*n,[0]*n
dp1,dp2=0,1
for i in range(n):
  if l[i]=='0':
    dp1*=3
  else:
    dp1*=3
    dp1+=dp2
    dp2*=2
  dp1%=mod
  dp2%=mod
print((dp1+dp2)%mod)
T = input()
lis = list(T)
n = lis.count("?")
 
temp = [i for i, x in enumerate(lis) if x == '?']
 
t =0
op_cnt = n
for i in range(2 ** n):
    op = ["P"] * n  # あらかじめ ["P", "P", "P"] というリストを作っておく
    for j in range(n):
        if ((i >> j) & 1):
            op[n - 1 - j] = "D"  # フラグが立っていた箇所を "D" で上書き
 
    for i, e in enumerate(op):
        lis[temp[i]] = e
        LIS = ''.join(lis)
        #print(t , LIS.count("PD"))
        if t < LIS.count("PD"):
            t = LIS.count("PD")
            List = LIS
            #print(t,LIS)
        else:
            pass
print(List)

### FIXED CODE ###

T = input()
print(T.replace("?","D"))
N = int(input())
H = list(map(int, input().split()))
lenH = len(H)
for i in range(lenH-1):
  h_2 = H[lenH-i]
  h_1 = H[lenH-i-1]
  if h_2 < h_1:
    if h_1 - h_2 > 1:
      print('No')
      break
    else:
	  H[lenH-i-1] -= 1
print('Yes')

### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
lenH = len(H)
if lenH <= 1:
  print('Yes')
  exit()
for i in range(lenH-1):
  h_2 = H[lenH-i-1]
  h_1 = H[lenH-i-2]
  if h_2 < h_1:
    if h_1 - h_2 > 1:
      print('No')
      exit()
    else:
      H[lenH-i-2] -= 1
print('Yes')
S = input()
 
if S == "ABC":
	print(ARC)

if S == "ARC":
  	print(ABC)

### FIXED CODE ###

S = input()

if S == "ABC":
    print("ARC")

if S == "ARC":
    print("ABC")
S = input()
remove_x = S.replace('x','')

s_len = len(S)
remove_x_len = len(remove_x)

if remove_x != remove_x[::-1]:
    print(-1)
else:
    if remove_x_len % 2 == 0:
        left = remove_x_len // 2
        center = -1
        right = left + 1
    else:
        left = remove_x_len // 2 
        center = left + 1
        right = left + 2
    
    left_index = 0
    right_index = 0
    center_index = 0

    left_x = []
    left_y = []

    count = 0
    for i, s in enumerate(S):
        if s != 'x':
            count += 1
        if count == left:
            left_index = i
            break
    count = 0
    for i, s in enumerate(S):
        if s != 'x':
            count += 1
        if count == right:
            right_index = i
            break
    count = 0
    for i, s in enumerate(S):
        if s != 'x':
            count += 1
        if count == center:
            center_index = i
            break


    #print(f'{left=}, {right=}')
    #print(f'{left_index=}, {right_index=}')
    tmp = 0
    for s in reversed(S[:left_index]):
        if s == 'x':
            tmp += 1
        else:
            left_x.append(tmp)
            tmp = 0
    left_x.append(tmp)

    tmp = 0
    for  s in S[right_index+1:]:
        if s == 'x':
            tmp += 1
        else:
            left_y.append(tmp)
            tmp = 0
    left_y.append(tmp)

    ans = 0
    for i in range(len(left_y)):
        ans += abs(left_x[i]-left_y[i])

    if remove_x_len % 2 != 0:
        ans += abs((right_index-center_index) - (center_index-left_index))
    
    print(ans)

### FIXED CODE ###

from collections import deque

S = input()

d = deque(S)


left = 0
right = len(d) - 1

count = 0
while left < right:
    #print(f'{left=}, {right=}')
    if d[right] == d[left]:
        left += 1
        right -= 1
    else:
        if d[right] == 'x':
            count += 1
            right -= 1
        elif d[left] == 'x':
            count += 1
            left += 1
        else:
            count = -1
            print(-1)
            break

if count != -1:
    print(count)
A = list(map(int,input().split()))
print(A[2]+" "+A[0]+" "+A[1])

### FIXED CODE ###

A = list(map(int,input().split()))
print(str(A[2])+" "+str(A[0])+" "+str(A[1]))
n = int(input())
a = list(map(int, input().split()))

ok = [True]*100005

a.sort()
ans=0
for i in range(n):
    if i<n-1 and a[i]!=a[i+1] and ok[a[i]]:
        ans+=1
    elif i==n-1 and ok[a[i]]:
        ans+=1
    if ok[a[i]]:
        for j in range(a[i],100004,a[i]):
            ok[j]=False

print(ans)

    


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))

ok = [True]*1000005

a.sort()
ans=0
for i in range(n):
    if i<n-1 and a[i]!=a[i+1] and ok[a[i]]:
        ans+=1
    elif i==n-1 and ok[a[i]]:
        ans+=1
    if ok[a[i]]:
        for j in range(a[i],1000004,a[i]):
            ok[j]=False

print(ans)
N,T=map(int,input().split())
min=1001
for i in range(N):
    c,t=map(int,input().split())
    if t<(T+1):
        if c<min:
            min=c           
if min=1001:
    print("TLE")
else:
    print(min)

### FIXED CODE ###

a=int(input())
if a==1:
    print("Hello World")
elif a==2 :
    b=int(input())
    c=int(input())
    print(b+c)
import numpy as np

N, K = map(int, input().split())
hs = np.array(list(map(int, input().split())))

i = 0
total_cost = 0
 
a.append(0,hs[1] - hs[0])

for i in range(2, N):
    bmin = float('inf')
    for j in range(max(i-K,0),i):
        bmin = min(bmin, a[j] + abs(hs[i] - hs[j]))
    a.append(bmin)

print(a[N-1])


### FIXED CODE ###

import numpy as np

N, K = map(int, input().split())
hs = np.array(list(map(int, input().split())))

i = 0
total_cost = 0
 
a = np.zeros(N, dtype=np.int64)
a[0] = 0
a[1] = abs(hs[1] - hs[0])

for i in range(2, N):
    k = min(K,i)
    a[i] = np.min(a[i-k:i] + np.abs(hs[i] - hs[i-k:i]))    
print(a[-1])
a,b=input().split()
print(min(a*(int(b),b*(int(a)))))


### FIXED CODE ###

a, b = input().split()
 
print(min(a*int(b), b*int(a) ) )
S=input()
S[3]=8
print(S)


### FIXED CODE ###

S=input()
S=S.replace("2017","2018")
print(S)
S = input()
atcg = ['A', 'C', 'T', 'G']
ans = 0
count = 0
for i in range(S):
  if S[i] in atcg:
    count += 1
    ans = max(count, ans)
  else:
    count = 0
print(ans)

### FIXED CODE ###

S = input()
atcg = ['A', 'C', 'T', 'G']
ans = 0
count = 0
for i in range(len(S)):
  if S[i] in atcg:
    count += 1
    ans = max(count, ans)
  else:
    count = 0
print(ans)
#個数が無制限のナップザックの問題(ただし、上限に注意)です(どの魔法を順番に選べば良いなどの制約がないのでナップザックDPを選択しました。)。
#dpの配列にはi番目の要素にモンスターの体力をi減らすために必要な最小の魔力を保存します。
#この配列は個数制限がないことに注意してinfではない要素のみを順に更新していけば良いです。
#また、最終的にモンスターの体力を最小の魔力で0以下にすれば良いので、モンスターの体力をh以上減らせる最小の魔力を求めれば良いです。

h,n=map(int,input().split())
a,b=[],[]
for i in range(n):
    a_sub,b_sub=map(int,input().split())
    a.append(a_sub)
    b.append(b_sub)
inf=10000000000000
ma=max(a)#ダメージの最大値

dp=[inf]*(h+ma)#与えるダメージの最大値を考慮したDP
dp[0]=0#初期値

for i in range(h+1+ma):# 与えるダメージ合計：0ーH+1+maまで
    if dp[i] == inf:#更新してきて、ダメージiになる組み合わせが存在しない場合は飛ばす
        continue
    for j in range(n):    #N個の魔法を試す
        ni = i + a[j] #今の状態から新しく与えた場合のダメージ合計
        if ni<h+ma:#オーバーキルの範囲を超えるなら、無視
            dp[ni] = min(dp[ni], dp[i] + b[j])        #ダメージniを与えるのにより小さい魔力で実現できる場合は更新
print(min(dp[h:]))


### FIXED CODE ###

#個数が無制限のナップザックの問題(ただし、上限に注意)です(どの魔法を順番に選べば良いなどの制約がないのでナップザックDPを選択しました。)。
#dpの配列にはi番目の要素にモンスターの体力をi減らすために必要な最小の魔力を保存します。
#この配列は個数制限がないことに注意してinfではない要素のみを順に更新していけば良いです。
#また、最終的にモンスターの体力を最小の魔力で0以下にすれば良いので、モンスターの体力をh以上減らせる最小の魔力を求めれば良いです。

h,n=map(int,input().split())
a,b=[],[]
for i in range(n):
    a_sub,b_sub=map(int,input().split())
    a.append(a_sub)
    b.append(b_sub)
inf=10000000000000
ma=max(a)#ダメージの最大値

dp=[inf]*(h+1+ma)#与えるダメージの最大値を考慮したDP
dp[0]=0#初期値

for i in range(h+1+ma):# 与えるダメージ合計：0ーH+1+maまで
    if dp[i] == inf:#更新してきて、ダメージiになる組み合わせが存在しない場合は飛ばす
        continue
    for j in range(n):    #N個の魔法を試す
        ni = i + a[j] #今の状態から新しく与えた場合のダメージ合計
        if ni<h+ma:#オーバーキルの範囲を超えるなら、無視
            dp[ni] = min(dp[ni], dp[i] + b[j])        #ダメージniを与えるのにより小さい魔力で実現できる場合は更新
print(min(dp[h:]))
import sys

def dfs(s, t):
    global V, d

    if t in V[s]:
        return True

    d[s] = 1
    for v in V[s]:
        if d[v] == 0:
            if dfs(v, t):
                return True

    return False

lines = sys.stdin.readlines()
n, m = map(int, lines[0].split())
V = [[] for _ in range(n)]
for i in range(1, m + 1):
    s, t = map(int, lines[i].split())
    V[s].append(t)
    V[t].append(s)

q = int(lines[m + 1])
for i in range(m + 2, m + q + 2):
    s, t = map(int, lines[i].split())
    d = [0] * (n)
    if dfs(s, t):
        print "yes"
    else:
        print "no"

### FIXED CODE ###

def bfs(i, c):
    global V, C

    q = [i]
    while len(q) > 0:
        j = q.pop()
        if C[j] == -1:
            C[j] = c
            q += V[j]

n, m = map(int, raw_input().split())
V = [[] for _ in range(n)]
C = [-1] * n
for _ in range(m):
    l, r = map(int, raw_input().split())
    V[l].append(r)
    V[r].append(l)

c = 0
for i in range(n):
    if C[i] == -1:
        bfs(i, c)
        c += 1

q = int(raw_input())
for _ in range(q):
    s, t = map(int, raw_input().split())
    if C[s] == C[t]:
        print "yes"
    else:
        print "no"
N,X,T=map(int,input().split)
if N//X<N/X<N//x+1:
  print((N//X+1)*T) 
else:
  print(N/X*T)

### FIXED CODE ###

N,X,T=map(int,input().split())
if N//X<N/X<N//X+1:
  print((N//X+1)*T) 
else:
  print(N//X*T)
a,b,c,d,e=map(int,input().split())
if a = 0:
  print(1)
elif b = 0:
  print(2)
elif c = 0:
  print(3)
elif d = 0:
  print(4)
else:
  print(5)

### FIXED CODE ###

a,b,c,d,e=map(int,input().split())
if a==0:
  print(1)
elif b==0:
  print(2)
elif c==0:
  print(3)
elif d==0:
  print(4)
else:
  print(5)
a, p = input().split()
ptint((a*3 + p) // 2)

### FIXED CODE ###

a, p = map(int, input().split())
ans = (a*3+p) // 2
print(ans)
n = int(input())

ans = 0

for i in range(1, n + 1):
  if i % 3 != 0 ans i % 5 != 0:
    ans += i

print(ans)

### FIXED CODE ###

n = int(input())

ans = 0

for i in range(1, n + 1):
  if i % 3 != 0 and i % 5 != 0:
    ans += i

print(ans)
a,b,k=map(int,input().split())
p=[]
for i in range(a):
  if a%i==0 and b%i==0:
    p.append(i)

n=len(p)
print(p[n-k])

### FIXED CODE ###

a,b,k=map(int,input().split())
p=[]
for i in range(1,a+1):
  if a%i==0 and b%i==0:
    p.append(i)

n=len(p)
print(p[n-k])
def main():
    H,W = map(int,input().split())
    S = [[1 if s == "." else 0 for s in input()] for _ in range(H)]
    R = [[0]*W for _ in range(H)]
    L = [[0]*W for _ in range(H)]
    D = [[0]*W for _ in range(H)]
    U = [[0]*W for _ in range(H)]

    for h in range(H):
        for w in range(1,W - 1):
            if S[h][w] and S[h][w - 1]:
                L[h][w] += L[h][w - 1] + 1
            if S[h][W - w] and S[h][W - w - 1]:
                R[h][W - w - 1] += R[h][W - w] + 1
        if S[h][W -1] and S[h][W - 2]:
            L[h][W - 1] += L[h][W - 2] + 1
        if S[h][0] and S[h][1]:
            R[h][0] += R[h][1] + 1
    for w in range(W):
        for h in range(1,H-1):
            if S[h-1][w] and S[h][w]:
                U[h][w] += U[h-1][w] + 1
            if S[H - h][w] and S[H - h - 1][w]:
                D[H - h - 1][w] += D[H - h][w] + 1
        if S[H - 1][w] and S[H - 2][w]:
            D[H - 1][w] += D[H-2][w] + 1
        if S[0][w] and S[1][w]:
            U[0][w] += U[1][w] + 1
    ans = 0
    for h in range(H):
        for w in range(W):
            ans = max(ans,U[h][w] + D[h][w] + R[h][w] + L[h][w])
    print(ans + 1)
    return 

if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    H,W = map(int,input().split())
    S = [[1 if s == "." else 0 for s in input()] for _ in range(H)]

    if H == 1:
        for w in range(1,W):
            if S[0][w] and S[0][w - 1]:
                S[0][w] += S[0][w - 1]
        print(max(S[0]))
        return
    if W == 1:
        ans = 0
        for h in range(1,H):
            if S[h][0] and S[h-1][0]:
                S[h][0] += S[h - 1][0]
                ans = max(ans,S[h][0])
        print(ans)
        return


    R = [[0]*W for _ in range(H)]
    L = [[0]*W for _ in range(H)]
    D = [[0]*W for _ in range(H)]
    U = [[0]*W for _ in range(H)]

    for h in range(H):
        for w in range(1,W - 1):
            if S[h][w] and S[h][w - 1]:
                L[h][w] += L[h][w - 1] + 1
            if S[h][W - w] and S[h][W - w - 1]:
                R[h][W - w - 1] += R[h][W - w] + 1
        if S[h][W -1] and S[h][W - 2]:
            L[h][W - 1] += L[h][W - 2] + 1
        if S[h][0] and S[h][1]:
            R[h][0] += R[h][1] + 1
    for w in range(W):
        for h in range(1,H-1):
            if S[h-1][w] and S[h][w]:
                U[h][w] += U[h-1][w] + 1
            if S[H - h][w] and S[H - h - 1][w]:
                D[H - h - 1][w] += D[H - h][w] + 1
        if S[H - 1][w] and S[H - 2][w]:
            D[H - 1][w] += D[H-2][w] + 1
        if S[0][w] and S[1][w]:
            U[0][w] += U[1][w] + 1
    ans = 0
    for h in range(H):
        for w in range(W):
            ans = max(ans,U[h][w] + D[h][w] + R[h][w] + L[h][w])
    print(ans + 1)
    return 

if __name__ == "__main__":
    main()
Bottom = min(A,B,C)
Middle = A+B+C - Top - Bottom
if (Middle - Bottom)%2 != 0:
  Top += 1
  Bottom += 1
  Answer = (Top -Middle) + (Middle - Bottom)//2 +1
else:
  Answer = (Top - Middle) + (Middle - Bottom)//2
print(Answer)

### FIXED CODE ###

A,B,C = map(int,input().split())
Top = max(A,B,C)
Bottom = min(A,B,C)
Middle = A+B+C - Top - Bottom
if (Middle - Bottom)%2 != 0:
  Top += 1
  Bottom += 1
  Answer = (Top -Middle) + (Middle - Bottom)//2 +1
else:
  Answer = (Top - Middle) + (Middle - Bottom)//2
print(Answer)
n = int(input())
s = 0
x = [s += int(i) for i in input().split()]
print(s - n)


### FIXED CODE ###

n = int(input())
x = [int(i) for i in input().split()]
print(sum(x) - n)
import math

class _const:
    def __init__(self):
        self.PI=math.acos(-1)
        self.convToDEG=180/self.PI
const=_const()


a,b,x=map(int,input().split(" "))

halfVolume=a*a*b/2

if x>=halfVolume:
    print(const.convToDEG*math.atan(2*(a*a*b-x)/a**3))

else:
    h=x/(a*b)
    print(const.convToDEG*math.acos(2*h/b))



### FIXED CODE ###

import math

class _const:
    def __init__(self):
        self.PI=math.acos(-1)
        self.convToDEG=180/self.PI
const=_const()


a,b,x=map(int,input().split(" "))

Volume=a*a*b

if 2*x>=Volume:
    print(const.convToDEG*math.atan(2*(a*a*b-x)/a**3))

else:
    r=2*x/(a*b*b)

    print(const.convToDEG*(const.PI/2-math.atan(r)))
s = list(int(input()))

if (s[5]*10 + s[6]) <= 4 and (s[8]*10 + s[9]) <=30:
    print("Heisei")
else:
    print("TBD")


### FIXED CODE ###


s = list(input())

if (int(s[5])*10 + int(s[6])) <= 4 and (int(s[8])*10 + int(s[9])) <=30:
    print("Heisei")
else:
    print("TBD")
n=int(input())
a=list(map(int,input().split()))
count4=0
count2=0

for i in a:
  if i%4==0:
    count4+=1
  elif i%2==0:
    count2+=1

if count2==1:
  count1=len(a)-count4
else:
  count1=len(a)-count4-count2
if len(a)==1 and a[0]==2:
elif count1-count4<=1:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
count4=0
count2=0

for i in a:
  if i%4==0:
    count4+=1
  elif i%2==0:
    count2+=1

if count2<1:
  count1=len(a)-count4
else:
  count1=len(a)-count4-count2+1
if count1-count4<=1:
  print("Yes")
else:
  print("No")
import sys
s = sys.stdin.readline().rstrip()
if len([y for y in s if y == 'x']) >= 8::
  print('NO')
else:
  print('YES')

### FIXED CODE ###

import sys
s = sys.stdin.readline().rstrip()
if len([y for y in s if y == 'x']) >= 8:
  print('NO')
else:
  print('YES')
import sys
from collections import defaultdict

def bs(arr, val):
	l, h = 0, len(arr)-1
	ans = -1
	while l <= h:
		m = l + h >> 1
		if arr[m] > val:
			ans = m
			h = m - 1
		else:
			l = m + 1
	return ans

s = sys.stdin.readline()
n = len(s)

t = sys.stdin.readline()

occurence = defaultdict(list)
for i in range(n):
	occurence[s[i]].append(i+1)

folds = 0
cur_ptr = 0
for ele in t:
	indexes = occurence[ele]
	idx = bs(indexes, cur_ptr)
	if idx != -1: 
		cur_ptr = indexes[idx]
	else:
		folds += 1
		cur_ptr = indexes[0]
ans = folds*(n) + cur_ptr
print(ans)

### FIXED CODE ###

import sys
from collections import defaultdict

def bs(arr, val):
	l, h = 0, len(arr)-1
	ans = -1
	while l <= h:
		m = l + h >> 1
		if arr[m] > val:
			ans = m
			h = m - 1
		else:
			l = m + 1
	return ans

s = sys.stdin.readline().strip()
n = len(s)

t = sys.stdin.readline().strip()

occurence = defaultdict(list)
for i in range(n):
	occurence[s[i]].append(i+1)

def solve():
	folds = 0
	cur_ptr = 0

	for ele in t:
		indexes = occurence[ele]
		if not indexes: return -1

		idx = bs(indexes, cur_ptr)
		if idx != -1: 
			cur_ptr = indexes[idx]
		else:
			folds += 1
			cur_ptr = indexes[0]
		# print(ele, cur_ptr, folds)
	ans = folds*(n) + cur_ptr
	return ans

print(solve())
N,M = map(int,(input().split()))
X = list(map(int,(input().split())))
X.sort()
if M > N:
    dist = [X[i+1]-X[i] for i in range(M - 1)]
    dist.sort(reverse = True)
        del dist[0:N]
    print(sum(dist))
else:
 print(0)

### FIXED CODE ###

N,M = map(int,(input().split()))
X = list(map(int,(input().split())))
X.sort()
if M > N:
    dist = [X[i+1]-X[i] for i in range(M - 1)]
    dist.sort(reverse = True)
    for i in range(N - 1):
        del dist[0]
    print(sum(dist))
else:
 print(0)
l=str(input())
n=0
for i in range(len(l)):
  if i%2==0,l[i]==0:
    n+=1
  if i%2==1,l[i]==1:
    n+=1
print(min(n,len(l)-n))

### FIXED CODE ###

l=str(input())
n=0
for i in range(len(l)):
  if i%2==0 and l[i]=='0':
    n+=1
  if i%2==1 and l[i]=='1':
    n+=1
print(min(n,len(l)-n))
N, A = map(int, raw_input() .split())
print N * N - A


### FIXED CODE ###

N = input()
A = input()
print N * N - A
import bisect
N,K=map(  int,raw_input().split() )
X=map(  int,raw_input().split() )

zero_idx=bisect.bisect_left(X,0)


ans=float("inf")
for i in range( max(0,zero_idx-K+1) , min(N,zero_idx+K) ):
	if i < zero_idx:
		if zero_idx-i==K:
			t=X[i]
		else:
			t=2*abs(X[i])+X[K-(zero_idx-i)-1+zero_idx]
	elif i>=zero_idx:
		if i-zero_idx==K-1:
			t=X[i]
		else:
			t=2*X[i]+ abs( X[zero_idx- ( K-(i-zero_idx+1) )] )
	ans=min(ans,t)

print ans

### FIXED CODE ###

N,K=map(  int,raw_input().split() )
X=map(  int,raw_input().split() )

ans=float("inf")
t=float("inf")
for l in range(N-K+1):
	r=l+K-1
	if X[l]<0:
		if X[r]<0:	
			ans=min(ans, abs(X[l]) )
		else:	
			ans=min(ans, 2*abs(X[l])+abs(X[r]) , abs(X[l])+2*abs(X[r]) )
	elif X[l]>=0 and X[r]>=0:
		ans=min(ans, X[r] )


print ans
a,b,c = map(int().split(","))
print(A,b,c)

### FIXED CODE ###

a,b,c = input().split(",")
print(a,b,c)
# -*- coding: utf-8 -*-
import sys
N = int(sys.stdin.readline())
line = sys.stdin.readline()
A = [ int(i) for i in line.strip().split() ]
min = 999999
for a in A:
    cnt = 0
    while(min > cnt):
        if a%2 == 1:
            min = cnt
            break
        else:
            a = a/2
            cnt += 1
print(cnt)



### FIXED CODE ###

# -*- coding: utf-8 -*-

import sys

for line in sys.stdin:
    print( sum( int(i) for i in line.strip() ) )
import numpy as np

N = int(input())
A = np.array(list(map(int, input().split())))
Q = int(input())
bc = [list(map(int, input().split())) for _ in range(Q)]

for i in range(Q):
    A[A==bc[i][0]] = bc[i][1]
    print(sum(A))

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
Q = int(input())
bc = [list(map(int, input().split())) for _ in range(Q)]

mem = [0]*(10**5)

sum = 0
for i in A:
    mem[i-1] += 1
    sum += i

for q in range(Q):
    b = bc[q][0]
    if mem[b-1] != 0:
        c = bc[q][1]
        num = mem[b-1]
        mem[c-1] += num
        mem[b-1] = 0
        sum = sum - num*b + num*c
    print(sum)
a,b = map(int,input())
print("ABlriocwen"[not abs(a-b)>1 :: 2])

### FIXED CODE ###

a,b = map(int,input().split())
print("ABlriocwen"[not abs(a-b)>1 :: 2])