Harryxun/stf_run huggingface dataset:
H, W = map(int, input().split())
s_a = []
for _ in range(W):
    s = list(input())
    s_a.append(s)

check_list = [(0,1),(0,-1),(1,0),(-1,0)]

def check(i,j):
    for x,y in check_list:
        try: 
            if s_a[i+x][j+y] == '#':
                return True
        except:
            continue
    return False

ans = 'Yes'
for i in range(W):
    for j in range(H):
        if s_a[i][j] == '#':
            if check(i,j):
                continue
            else:
                ans = 'No'
                break
print(ans) 

### FIXED CODE ###

H, W = map(int, input().split())
s_a = []
for _ in range(H):
    s = list(input())
    s_a.append(s)

check_list = [(0,1),(0,-1),(1,0),(-1,0)]

def check(i,j):
    for x,y in check_list:
        try: 
            if s_a[i+x][j+y] == '#':
                return True
        except:
            continue
    return False

ans = 'Yes'
for i in range(H):
    for j in range(W):
        if s_a[i][j] == '#':
            if check(i,j):
                continue
            else:
                ans = 'No'
                break
print(ans)
import math
a,b = input().split()

n = int(a+b)

for i in range(1000):
  if i**2 = n:
    print("Yes")
    exit()

print("No")

### FIXED CODE ###


a,b = input().split()

n = int(a+b)

for i in range(1000):
  if i**2 == n:
    print("Yes")
    exit()

print("No")
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
import operator
from functools import reduce
from fractions import gcd
#from math import gcd
import sys
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


n, k = Is()
A = LI()
right = 1
ans = 0
SA = [0]  # SA[0]~SA[n]
SA += list(accumulate(A, operator.add))
for left in range(n):
    if left == right:
        right += 1

    while right < n and SA[right]-SA[left] < k:
        right += 1

    if right == n and SA[right]-SA[left] < k:
        break
    else:
        ans += n - right + 1

print(ans)


### FIXED CODE ###

from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
#from math import gcd
import sys
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


x, a = Is()
if x < a:
    print(0)
else:
    print(10)
# -*- coding: utf-8 -*-
# input
a, b = map(int, input().split())
s = input()
print(s[:b-1]+s[b-1:b].lower()+s[b:a]

### FIXED CODE ###

a, b = map(int, input().split())
s = input()
print(s[:b-1]+s[b-1:b].lower()+s[b:a])
import itertools
import numpy as np

n, m, x= map(int, input().split())
a = [input().split() for l in range(n)]
npa=np.array(a, dtype=int)

#print (npa)

hon=-1
for i in range(1,n+1):
  base = list(itertools.combinations(range(0,n),i))
#  print (base)
  
  for j in base:
    totalv=np.sum(npa[j,], axis=0)
#    print (totalv, min(totalv[1:-1]))
    
    if (min(totalv[1:-1]) >= x):
      if (hon < 0): hon=totalv[0]
      if (hon >= totalv[0]): hon=totalv[0]
#      print (hon)
      
print (hon)

### FIXED CODE ###

import itertools
import numpy as np

n, m, x= map(int, input().split())
a = [input().split() for l in range(n)]
npa=np.array(a, dtype=int)

hon=-1
for i in range(1,n+1):
  base = list(itertools.combinations(range(0,n),i))
#  print (base)
  
  for j in base:
    totalv=np.sum(npa[j,], axis=0)
#    print (totalv, min(totalv[1:-1]))
    
    if (min(totalv[1:m+1]) >= x):
      if (hon == -1): hon=totalv[0]
      if (hon >= totalv[0]): hon=totalv[0]
#      print (hon)
      
print (hon)
S, T = map(str, input().split)
A, B = map(int, input().split)
inPut()

a = A - 1
b = B - 1

if U == S:
  print({} {}.format(a,B))
else:
  print({} {}.format(A.b))

### FIXED CODE ###

S, T = map(str, input().split())
A, B = map(int, input().split())
U = input()

a = A - 1
b = B - 1

if U == S:
  print('{} {}'.format(a,B))
else:
  print('{} {}'.format(A,b))
0 33 66 99

### FIXED CODE ###

a,b,c,d=map(int,input().split())
if b<=c or d<=a:
  print(0)
elif a<c:
  print(min(d,b)-c)
else:
  print(min(b,d)-a)
A,B,T=map(int, input().split())
t_max = int((T+0.5)/(A))
for t in range(t_max):
	bis += B*(t+1)
print(bis)

### FIXED CODE ###

A,B,T=map(int, input().split())
t_max = int((T+0.5)/A)
print(t_max*B)
N,M=map(int,input().split())
keep=[]
lis=[]
ac=[0]*N
wa=[0]*N
WA=0
for i in range(M):
    ps=input().split()
    keep.append(ps)
    
for j in range(M):
    if keep[j][1]=="AC":
        ac[int(keep[j][0])]=1
    elif ac[int(keep[j][0])]==0:
        wa[int(keep[j][0])]+=1
AC=sum(ac)
for j in range(M):
    WA+=ac[j]*wa[j]
    
print(AC,WA)

### FIXED CODE ###

N,M=map(int,input().split())
keep=[]
lis=[]
ac=[0]*N
wa=[0]*N
WA=0
for i in range(M):
    ps=input().split()
    keep.append(ps)
    
for j in range(M):
    if keep[j][1]=="AC":
        ac[int(keep[j][0])-1]=1
    elif ac[int(keep[j][0])-1]==0:
        wa[int(keep[j][0])-1]+=1
AC=sum(ac)
for k in range(N):
    WA+=ac[k]*wa[k]
    
print(AC,WA)
lenghts = int(input())
document = input()

count = 0
for start in range(lenghts -2):
  if document[start: start+3] == 'ABC':
    count += 1
  
print(count)

### FIXED CODE ###

input_line = input()
Line = input_line.split()
if 500*int(Line[0]) >= int(Line[1]):
  print('Yes')
else:
  print('No')
# import sys
# input = sys.stdin.readline
import bisect


def ch_to_int(c):
    return ord(c) - 96


def main():
    s = input()
    t = input()
    pos = 0
    count = 0
    ch = [[] for i in range(26)]

    for i in range(len(s)):
        ch[ch_to_int(s[i])].append(i)

    for i in range(len(t)):
        c = ch_to_int(t[i])
        li = ch[c]

        if len(li) == 0:
            pos = -2
            count = 0
            break

        next_index = bisect.bisect_right(li, pos)
        if next_index >= len(li):
            next_pos = li[0]
            count += 1
            pos = next_pos
        else:
            pos = li[next_index]

    print((pos + 1) + count * len(s))


if __name__ == '__main__':
    main()


### FIXED CODE ###


# import sys
# input = sys.stdin.readline
import bisect


def ch_to_int(c):
    return ord(c) - 96


def main():
    s = input()
    t = input()
    pos = 0
    count = 0
    ch = [[] for i in range(27)]

    for i in range(len(s)):
        ch[ch_to_int(s[i])].append(i)

    for i in range(len(t)):
        c = ch_to_int(t[i])
        li = ch[c]

        if len(li) == 0:
            pos = -1
            count = 0
            break

        next_index = bisect.bisect_left(li, pos)
        # print(next_index, pos, li)
        if next_index >= len(li):
            next_pos = li[0]
            count += 1
            pos = next_pos + 1
        else:
            if pos == li[next_index]:
                pos += 1
            else:
                pos = li[next_index] + 1
        # print(li, next_index, pos, count)

    print(pos + count * len(s))


if __name__ == '__main__':
    main()
while True:
      try:
            hand = sorted(map(int, raw_input().split(",")))
            kind = len(set(hand))
            ma = max([hand.count(i) for i in hand])
            if kind == 4:
                  print "one pair"
            elif kind == 3:
                  if ma == 2:
                        print "two pair"
                  else:
                        print "three card"
            elif kind == 2:
                  if ma==4:
                        print "four card"
                  else:
                  print "full house"
            else:
                  if hand==[1,10,11,12,13] or hand[4] - hand[0] == 4:
                        print "straight"
                  else:
                        print "null"
      except:
            break

### FIXED CODE ###

while True:
      try:
            hand = sorted(map(int, raw_input().split(",")))
            kind = len(set(hand))
            ma = max([hand.count(i) for i in hand])
            if kind == 4:
                  print "one pair"
            elif kind == 3:
                  if ma == 2:
                        print "two pair"
                  else:
                        print "three card"
            elif kind == 2:
                  if ma==4:
                        print "four card"
                  else:
                        print "full house"
            else:
                  if hand==[1,10,11,12,13] or hand[4] - hand[0] == 4:
                        print "straight"
                  else:
                        print "null"
      except:
            break
N, K = map(int, input().split())
 
c = 0
for i in range(K, N + 1 + 1):
    ma = ((N + N - (i - 1)) * i) / 2
    mi = ((0 + i - 1) * i) / 2
    c += int(ma - mi + 1)
 	c %= (10 ** 9 + 7)
print(c)

### FIXED CODE ###

n, k = map(int, input().split())

c = 0
for i in range(k, n + 2):
  c += ((n - i + 1) * i + 1) % (10 ** 9 + 7)

print(c % (10 ** 9 + 7))
m=int(n)
e2=0
e5=0

while m>1:
    if m%5!=0 and m%2!=0:
        continue
    m2=m
    m5=m
    while m2%2==0:
        e2=e2+1
        m2=m2/2
    while m5%5==0:
        e5=e5+1
        m5=m5/5
    m=m-2

print(min(e2,e5))


### FIXED CODE ###

A = int(input())  
B = int(input())  

print(6-A-B)
n,m=int(input()).split()
if n==m:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n,m=input().split()
if n==m:
  print("Yes")
else:
  print("No")
n = int(input())

g = [[-1 for j in range(n)] for i in range(n)]

for i in range(n):
	a = int(input())
	for _ in range(a):
		x, y = map(int, input().split())
		g[i][x-1] = y

ans = 0
for s in range(2**n):
	ok = True
	for i in range(n):
		if (s>>i&1) == 1:
			for j in range(n):
				if g[i][j] != -1 and (s>>j&1) != g[i][j]:
                    ok = False
	if ok:
		ans = max(ans, bin(s).count("1"))

print(ans)


### FIXED CODE ###

n = int(input())

g = [[-1 for j in range(n)] for i in range(n)]

for i in range(n):
	a = int(input())
	for _ in range(a):
		x, y = map(int, input().split())
		g[i][x-1] = y

ans = 0
for s in range(2**n):
	ok = True
	for i in range(n):
		if (s>>i&1) == 1:
			for j in range(n):
				if g[i][j] == -1: continue
				if (s>>j&1) != g[i][j]: ok = False
	if ok:
		ans = max(ans, bin(s).count("1"))

print(ans)
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 20 10:11:22 2020

@author: NEC-PCuser
"""

N, K = map(int, input().split())

A = list(map(int, input().split()))

tele_set = set()
tele_set.add(1)
junkai_town = -1 
junkai_first = -1
junkai_second = -1
for i in range(N):
    if A[i] not in tele_set:
        tele_set.add(A[i])
    else:
        junkai_town = A[i] - 1
        junkai_second = i
        break

town = 0
start_flg = False
junkaimae_list = []
junkai_list = []
for i in range(N):
    if town == junkai_town and start_flg == False:
        junkai_first = i
        start_flg = True
    elif town == junkai_town:
        break
    if start_flg == True:
        junkai_list.append(town)
    else:
        junkaimae_list.append(town)
    town = A[town] - 1

if K <= len(junkaimae_list):
    print(junkaimae_list[K - 1] + 1)
else:
    kaisu = K - len(junkaimae_list)
    print(junkai_list[kaisu % len(junkai_list)] + 1)

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sat Jun 20 10:11:22 2020

@author: NEC-PCuser
"""

N, K = map(int, input().split())

A = list(map(int, input().split()))

tele_set = set()
tele_set.add(1)
junkai_town = -1 
junkai_first = -1
town = 1
for i in range(N):
    if A[town - 1] not in tele_set:
        tele_set.add(A[town - 1])
    else:
        junkai_town = A[town - 1]
        break
    town = A[town - 1] 

town = 1
start_flg = False
junkaimae_list = []
junkai_list = []
for i in range(N):
    if town == junkai_town and start_flg == False:
        junkai_first = i
        start_flg = True
    elif town == junkai_town:
        break
    if start_flg == True:
        junkai_list.append(town)
    else:
        junkaimae_list.append(town)
    town = A[town - 1]


if K < len(junkaimae_list):
    print(junkaimae_list[K])
else:
    kaisu = K - len(junkaimae_list)
    print(junkai_list[kaisu % len(junkai_list)])
import numpy as np
N,K = map(int, input().split())

A_list = np.array([0]+list(map(int, input().split())))
#print(A_np)

new_A=np.array([0]*(N+2))
for j in range(1):
  for i in range(1,N+1):
    print(new_A)
    mi=i-A_list[i]
    ma=i+A_list[i]
    if mi<0:
      mi=0
    if ma>N+1:
      ma=N+1
    #new_A[mi:ma+1]+=1
    new_A[mi]+=1
    new_A[ma+1]-=1

  A_list=np.cumsum(new_A)
  if sum(A_list[1:N+1])==N*N:
    break
    
for i in range(1,N+1):
  print(A_list[i],end=" ")


### FIXED CODE ###

import numpy as np
from numba import njit

N,K = map(int, input().split())

A_list = np.array([0]+list(map(int, input().split())))

@njit
def update(A_list):

  for j in range(min(K,46)):
    new_A=np.zeros(N+2,dtype=np.int64)
    for i in range(1,N+1):
      #print(new_A)
      mi=i-A_list[i]
      ma=i+A_list[i]
      if mi<0:
        mi=0
      if ma>N:
        ma=N
      #new_A[mi:ma+1]+=1
      new_A[mi]+=1
      new_A[ma+1]-=1

    A_list=np.cumsum(new_A)
    #if sum(A_list[1:N+1])==N*N:
    #  return(A_list)    
    #  break
      
  return(A_list)

A_list=update(A_list)
for i in range(1,N+1):
  print(A_list[i],end=" ")
a =  int(input())
a = list(map(int, input().split()))
a.sort()

d_num = a

div = []
a_set = list(set(a))
flag = False
if len(a_set) == 1:
    print(0)
else:
    for i in range(len(a_set)):
        flag = False
        for j in range(len(div)):
            if(a_set[i]%div[j] == 0):
                d_num -= 1
                flag = True
                break
        if flag == False:
            div.append(a_set[i])
    print(1)


### FIXED CODE ###

n = int(input())
A = list(map(int, input().split()))
A.sort()

ndiv_sum = 0
max_num = A[-1]
no_div = [True] * (max_num+1)
for i in range(len(A)-1):
    if no_div[A[i]]:
        for j in range(A[i], max_num+1, A[i]):
            no_div[j] = False
        if A[i]!=A[i+1]:
            ndiv_sum += 1
if no_div[A[-1]]:
    ndiv_sum += 1
print(ndiv_sum)
n,k = map(int, list(input().split()))
s_base = input()

def maxdpt(depth, slist):
    # すべて1の場合は終了
    if slist.count('1') == len(slist): 
        return len(slist)
    
    # 深さ最大の場合は終了
    if depth+1>k:
        return max(list(map(len, slist.split('0'))))

    max_len=0
    str_len=0
    for i,c in enumerate(slist):   # 0の部分文字列を取得
        if c=='1':
            continue
        # 0の部分文字列を仮に変えてみる
        for j in range(i+1,len(slist)):
            #次の1まで
            if slist[j]=='1':
                break
        s_tmp=list(slist)
        for index in range(i,j):
            s_tmp[index]='1'
        s_tmp = "".join(s_tmp)
        max_len=max(max_len,maxdpt(depth+1,s_tmp))
        i=j
    return max_len

print(maxdpt(0,s_base))

### FIXED CODE ###

n,k = map(int, list(input().split()))
s = list(map(int, list(input())))

# 1-0-1-0-1の形式で集計する
count=0
now=1
num_list=[]
for c_i in s:
    if c_i == now:
        count+=1
    else:
        num_list.append(count)
        count=1
        now=1-now
num_list.append(count)

# 最後が0のグループだと都合が悪い
if len(num_list)%2==0:
    num_list.append(0)

# 累積和を使って部分列の合計の最大値を求める
max_len=0
now_sum=0
left=0
right=0

for i in range(0,len(num_list),2):
    nextleft=i
    nextright=min(len(num_list),i+2*k+1)

    while left<nextleft:
        now_sum-=num_list[left]
        left+=1
    while right<nextright:
        now_sum+=num_list[right]
        right+=1
    max_len=max(max_len,now_sum)
    
print(max_len)
import sys
from collections import deque
input = sys.stdin.readline

N,mod=map(int,input().split())
EDGE=[list(map(int,input().split())) for i in range(N-1)]

#N=10**5
#mod=10**8
#import random
#EDGE=[[i,random.randint(1,i-1)] for i in range(2,N+1)]

EDGELIST=[[] for i in range(N+1)]

for x,y in EDGE:
    EDGELIST[x].append(y)
    EDGELIST[y].append(x)

QUE=deque()
DPDICT=dict()

for i in range(1,N+1):
    if len(EDGELIST[i])==1:
        #DPDICT[(i,EDGELIST[i][0])]=2
        QUE.append(i)


def SCORE(point):
    ANS=1
    for to in EDGELIST[point]:
        ANS=ANS*DPDICT[(to,point)]%mod
    return ANS

def dp(x,y):
    if DPDICT.get((x,y))!=None:
        return DPDICT[(x,y)]

    ANS=1
    for to in EDGELIST[x]:
        if to==y:
            continue
        ANS=ANS*dp(to,x)%mod

    DPDICT[(x,y)]=ANS+1
    return ANS+1

while QUE:
    x=QUE.pop()
    for to in EDGELIST[x]:
        if DPDICT.get((x,to))==None:
            dp(x,to)
            QUE.append(to)


for i in range(1,N+1):
    print(SCORE(i))

### FIXED CODE ###

import sys
from collections import deque
input = sys.stdin.readline
sys.setrecursionlimit(10**9)

N,mod=map(int,input().split())
EDGE=[list(map(int,input().split())) for i in range(N-1)]

if N==1:
    print(1)
    sys.exit()

EDGELIST=[[] for i in range(N+1)]
for x,y in EDGE:
    EDGELIST[x].append(y)
    EDGELIST[y].append(x)

SCORELIST=[[-1]*len(EDGELIST[i]) for i in range(N+1)]
PRODLIST=[[-1]*len(EDGELIST[i]) for i in range(N+1)]
PRODLIST_rev=[[-1]*len(EDGELIST[i]) for i in range(N+1)]
EDICT=dict()

for i in range(1,N+1):
    for j in range(len(EDGELIST[i])):
        EDICT[(i,EDGELIST[i][j])]=j

def dp(x,y):
    if SCORELIST[y][EDICT[(y,x)]]!=-1:
        return SCORELIST[y][EDICT[(y,x)]]

    ANS=1
    for to in EDGELIST[x]:
        if to==y:
            continue
        ANS=ANS*dp(to,x)%mod

    SCORELIST[y][EDICT[(y,x)]]=ANS+1   
    return ANS+1

def dp2(x,y):
    if PRODLIST[x][0]==-1:
        PRODLIST[x][0]=(SCORELIST[x][0])%mod
        for i in range(1,len(EDGELIST[x])):
            PRODLIST[x][i]=PRODLIST[x][i-1]*SCORELIST[x][i]%mod

        PRODLIST_rev[x][-1]=SCORELIST[x][-1]
        for i in range(len(EDGELIST[x])-2,-1,-1):
            PRODLIST_rev[x][i]=PRODLIST_rev[x][i+1]*SCORELIST[x][i]%mod

    if len(EDGELIST[x])==1:
        ANS=1
    elif EDICT[(x,y)]==0:
        ANS=PRODLIST_rev[x][1]
    elif EDICT[(x,y)]==len(EDGELIST[x])-1:
        ANS=PRODLIST[x][EDICT[(x,y)]-1]
    else:
        ANS=PRODLIST[x][EDICT[(x,y)]-1]*PRODLIST_rev[x][EDICT[(x,y)]+1]%mod

    SCORELIST[y][EDICT[(y,x)]]=ANS+1

for to in EDGELIST[1]:
    dp(to,1)

QUE=deque([1])
check=[0]*(N+1)

while QUE:
    x=QUE.pop()
    if check[x]==1:
        continue
    for to in EDGELIST[x]:
        if check[x]==0 or check[to]==0:
            dp2(x,to)
            QUE.append(to)
    check[x]=1

for i in range(1,N+1):
    print(PRODLIST[i][-1])
H,W = raw_input().spllit()
for height in range(H):
    if height == H-1 or height == 0:
        print "#"*W
    else:
        print "#"+ "."*(W-2)+"#"

### FIXED CODE ###

while True:
    h,w = tuple([int(x) for x in raw_input().split(" ")])
    if h==0 and w==0: break
 
    for ih in range(h):
        if ih==0 or ih==h-1 or w <= 2: print "#" * w
        else: print "#" + "." * (w-2) + "#"
 
    print ""
S = list(input())
lon = len(S)
count = 0
num = S.count("?")

if S == "?":
  print("D")
is S == "P?":
  print("PD")
if S == "D?":
  print("DD")
if S == "?D":
  print("PD")
if S == "?P":
  print("DP")

#print(S)

if S[0] == "?":
  if S[1] == "D":
    S[0] = "P"
  else:
    S[0] = "D"
    
if S[-1] == "?":
  if S[-2] == "P":
    S[-1] = "D"
  else:
    S[-1] = "D"
    
    
for i in range(1, lon-1):
  if S[i] == "?":
    if S[i-1] == "P":
      S[i] = "D"
    elif S[i-1] == "D":
      S[i] = "P"

    
T = "".join(S)
#print(T.count("D") + T.count("PD") )
print(T)

### FIXED CODE ###

S = list(input())
lon = len(S)
for i in range(lon):
  if S[i] == "?":
    S[i] = "D"
 
    

T = "".join(S)
#print(T.count("D") + T.count("PD") )
print(T)
r=int(input())
print=(3r**2)

### FIXED CODE ###

r=int(input())
s=3*r**2
print(s)
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
  #  print(g1[n],g2[r],g2[n-r])
    return g1[n] * g2[r] * g2[n-r] % mod

x,y = map(int,input().split())
n = (2*y-x)/3
m = (2*x-y)/3

if n <= 0 or m <= 0:
    print(0)
elif int(n) != n or int(m) != m:
    print(0)
else:
    mod = 10**9+7 #出力の制限
    N = n+m
    g1 = [1, 1] # 元テーブル
    g2 = [1, 1] #逆元テーブル
    inverse = [0, 1] #逆元テーブル計算用テーブル
    
    for i in range( 2, N + 1 ):
        g1.append( ( g1[-1] * i ) % mod )
        inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
        g2.append( (g2[-1] * inverse[-1]) % mod )
    ans = cmb(n+m,n,mod)
    print(ans)

### FIXED CODE ###

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
  #  print(g1[n],g2[r],g2[n-r])
    return g1[n] * g2[r] * g2[n-r] % mod

x,y = map(int,input().split())
n = (2*y-x)/3
m = (2*x-y)/3

if n < 0 or m < 0:
    print(0)
elif int(n) != n or int(m) != m:
    print(0)
else:
    n = int(n)
    m = int(m)
    mod = 10**9+7 #出力の制限
    N = n+m
    g1 = [1, 1] # 元テーブル
    g2 = [1, 1] #逆元テーブル
    inverse = [0, 1] #逆元テーブル計算用テーブル
    
    for i in range( 2, N + 1 ):
        g1.append( ( g1[-1] * i ) % mod )
        inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
        g2.append( (g2[-1] * inverse[-1]) % mod )
    ans = cmb(n+m,n,mod)
    print(ans)
N = int(input())

s = input().split()

s.sort(reverse=True)

sum = 0

for i in range(N):
  sum = sum + s[2*i]

print(sum)

### FIXED CODE ###

N = int(input())

s = list(map(int,input().split()))

s.sort()

sum = 0

for i in range(N):
  sum = sum + s[2*i]

print(sum)
t = input()
s = [i for i in t]
if s[0] == "?":
    if s[1] == "D":
        s[0] = "P"
    s[0] = "D"
for i in range(1, len(t) - 1):
    if s[i-1] == "D" and s[i+1] == "D":
        s[i] = "P"
    elif s[i-1] == "D" and s[i+1] == "?":
        s[i] = "P"
    else:
        s[i] = "D"
if s[-1] == "?":
    s[-1] = "D"
print("".join(s))

### FIXED CODE ###

t = input()
s = [i for i in t]
if s[0] == "?":
    s[0] = "D"
for i in range(1, len(t) - 1):
    if s[i] == "?":
        if s[i-1] == "D" and s[i+1] == "D":
            s[i] = "P"
        elif s[i-1] == "p" and s[i+1] == "P":
            s[i] = "D"
        elif s[i-1] == "D" and s[i+1] == "?":
            s[i] = "P"
        elif s[i-1] == "P" and s[i+1] == "?":
            s[i] = "D"
        else:
            s[i] = "D"
if s[-1] == "?":
    s[-1] = "D"
print("".join(s))
a, b = map(int, input().split())
if a <= 2b:
  print("0")
else:
  print(a-2b)


### FIXED CODE ###

a, b = map(int, input().split())
if a <= 2*b:
  print(0)
else:
  print(a-2*b)
N=int(input())
S,T=input().split()
ans=str()
for i in range(N):
    ans+=S[i]
    ans+=T[j]


print(ans)

### FIXED CODE ###

n = int(input())
s, t = input().split()

ans = str()
for i in range(n):
    ans += s[i]
    ans += t[i]

print(ans)