Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

s = input()
mini = s
maxi = s
for i in range(len(s)):
    if s[i] == "?":
        if i != 0 or i!= len(s) - 1:
            mini = mini[:i] + "0" + mini[i+1:]
            maxi = maxi[:i] + "9" + maxi[i+1:]
        elif i == 0:
            mini = "0" + mini[1:]
            maxi = "9" + maxi[1:]
        elif i == len(s) - 1:
            mini = mini[:len(s)-1] + "0"
            maxi = maxi[:len(s)-1] + "9"
        
    
mini = int(mini)
maxi = int(maxi)

count = 0
i = mini
while i <= maxi:
    if i % 13 == 5:
        flag = True
        i_str = str(i)
        if len(i_str) < len(s):
            i_str = "0" * (len(s) - len(i_str)) + i_str
        for j in range(len(s)):
            if s[j] == "?" or i_str[j] == s[j]:
                continue
            else:
                flag = False
                break
        if flag == True:
            count += 1
        i += 13
    else:
        i += 1
print(count % (10**9 + 7))


### FIXED CODE ###

s = input()
dp = [[0 for i in range(13)]]
if s[-1] != "?":
    dp[0][int(s[-1]) % 13] += 1
else:
    for k in range(10):
        dp[0][k % 13] += 1
        
d = [1]   
for i in range(1,len(s)):
    dp.append([0]*13)
    d.append(d[i-1]*10 % 13)
    for r in range(13):
        if s[-(i+1)] == "?":
            for k in range(10): 
                dp[i][(k * d[i] + r) % 13] += dp[i-1][r] % (10**9 + 7)
                
        else:
            dp[i][(int(s[-(i+1)]) * d[i] + r) % 13] += dp[i-1][r] % (10**9 + 7)

print(dp[len(s)-1][5]%(10**9+7))
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=False)

#N = 12
#A = [12,9,9,6,6,5,5,4,3,2,1,1]

ret = 0
array = []
array.append(A.pop())
while len(A) > 0:
    #print('array', array)
    comfort = [0 for i in range(len(array))]
    for i in range(len(comfort)):
        comfort[i] = min(array[i-1], array[i])
    #print('comfort', comfort)
    val = max(comfort)
    ret += val
    #print('ret', ret)
    array.insert(comfort.index(val), A.pop())

print(ret)


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=False)

ret = 0
c_pointer = 0
comfort = []
tmp = A.pop()
comfort.append(tmp)

while len(A) > 0:
    tmp = A.pop()
    c_pointer += 1
    comfort.append(tmp)
    comfort.append(tmp)

print(sum(comfort[:c_pointer]))
### BUGGY CODE ###

from scipy.sparse.csgraph import floyd_warshall
import numpy as np
N, X, Y = map(int, input().split())
X -= 1
Y -= 1

g = np.zeros((N, N), dtype=int)
a = np.arange(N - 1)
np.add.at(g, (a, a + 1), 1)
np.add.at(g, (a + 1, a), 1)
np.add.at(g, (X, Y), 1)
np.add.at(g, (Y, X), 1)
fw = floyd_warshall(g)
fw = (fw + 0.5).astype(int)
fw = np.tril(fw).ravel()
fw = fw[fw > 0]

cnt = np.bincount(fw).tolist()
ans = [0] * (N - 1)
for i, c in enumerate(cnt[1:]):
    ans[i] = c

print(*ans, sep="\n")

### FIXED CODE ###

from scipy.sparse.csgraph import dijkstra
import numpy as np
N, X, Y = map(int, input().split())
X -= 1
Y -= 1

g = np.zeros((N, N), dtype=int)
a = np.arange(N - 1)
np.add.at(g, (a, a + 1), 1)
np.add.at(g, (a + 1, a), 1)
np.add.at(g, (X, Y), 1)
np.add.at(g, (Y, X), 1)
fw = dijkstra(g, directed=False)
fw = (fw + 0.5).astype(int)
fw = np.tril(fw).ravel()
fw = fw[fw > 0]

cnt = np.bincount(fw).tolist()
ans = [0] * (N - 1)
for i, c in enumerate(cnt[1:]):
    ans[i] = c

print(*ans, sep="\n")
### BUGGY CODE ###

from collections import Counter
N = int(input())
A = Counter(list(map(int, input().split(' '))))
ans = 0
for i in A.keys():
    flg = True
    if A[i] > 1:
        continue
    tmp = set([])
    for j in range(1,int(i**0.5)+2):
        if not i%j:
            tmp.add(j)
            tmp.add(i//j)
    for k in tmp:
        if A[k] and i != k:
            flg = False
            break
    if flg:
        ans += 1
print(ans)


### FIXED CODE ###

from collections import Counter
N = int(input())
A = Counter(list(map(int,input().split(' '))))
ans = 0
m = max(A.keys())
L = [1]*(10**6+1)
for i in sorted(A.keys()):
    if not L[i]:
        continue
    if A[i] == 1:
        ans += 1
    for j in range(i,m+1,i):
        L[j] = 0
print(ans)
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
if 0 in A:
    ans = 0
else:
    ans = 1
    for a in A:
        ans *= a

    if ans > 10**18:
        ans = -1
print(ans)
    

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
if 0 in A:
    ans = 0
else:
    ans = 1
    for a in A:
        ans *= a
        if ans > 10**18:
            ans = -1
            break
print(ans)
### BUGGY CODE ###

s=input()
q=int(input())
queries = []
rev = [0]*q
flag=0
for i in range(q):
    query = list( input().split() )
    queries.append( query )
    if query==["1"]:
        flag+=1
    rev[i]=flag

n_rev = queries.count(["1"])
rev = [rr+n_rev for rr in rev]
left=""
right=""
for i,query in enumerate(queries):
    if query!=["1"]:
        if rev[i]%2==0:
            if query[1]=="1":
                left=query[2]+left
            else:
                right=right+query[2]
        else:
            if query[1]=="1":
                right=right+query[2]
            else:
                left=query[2]+left 
#     print(i,left,s,right)
if n_rev%2==1:
    s=s[::-1]
print(left+s+right)

### FIXED CODE ###


s=input()
q=int(input())
queries = []
rev = [0]*q
flag=0
for i in range(q):
    query = list( input().split() )
    queries.append( query )
    if query==["1"]:
        flag+=1
    rev[i]=flag

n_rev = flag
from collections import deque
left=deque([])
right=deque([])
for r,query in zip(rev,queries):
    if query!=["1"]:
        q1 = query[1]
        q2 = query[2]
        if (r+n_rev)%2==0:
            if q1=="1":
                left.appendleft(q2)
            else:
                right.append(q2)
        else:
            if q1=="1":
                right.append(q2)
            else:
                left.appendleft(q2) 
#     print(i,left,s,right)
if n_rev%2==1:
    s=s[::-1]
print("".join(["".join(left),s,"".join(right)]) )
### BUGGY CODE ###

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

for count in range(n[2]):
    if n[0] > 0:
        n[0]-=1
        count+=1
    elif n[1] > 0:
        n[1]-=1
        count+=1

print(str(n[0]) + " " + str(n[1]))

### FIXED CODE ###

A, B, K = map(int, input().split())

if A > K:
  print(A - K, B)
elif B - (K - A) > 0:
  print(0, B - (K - A))
else:
  print(0,0)
### BUGGY CODE ###

import math

A, B, N = map(int, input().split(' '))

_max = 0
for x in range(1, N+1):
    num =math.floor(A * x / B) - A * math.floor(x/B) 
    if  num > _max:
        _max = num

print(_max)


### FIXED CODE ###

import math

def floor(A, B, x):
    return math.floor(A * x / B) - A * math.floor(x/B) 

A, B, N = map(int, input().split(' '))
x = min(N, B-1)
print(floor(A,B,x))
### BUGGY CODE ###

from collections import defaultdict, deque
import sys

sys.setrecursionlimit(100000)

MIN = -10 ** 9
MAX = 10 ** 9 + 7


def d(n):
    divisors = []
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i * i != n:
                divisors.append(n // i)

    return divisors


def main():
    N = int(input())
    # A = [
    #     int(input())
    #     for _ in range(N)
    # ]
    A = [int(a) for a in input().split()]

    res_c = 0
    res1 = []
    bucket = [0] * (N + 1)

    i = N
    for Ai in reversed(A):
        i -= 1
        k = i + 1
        if k * 2 > N:
            if Ai == 1:
                res_c += 1
                res1.append(k)
                for di in d(k):
                    bucket[di] += 1
                # sq = int(k ** 0.5)
                # if sq * sq == k:
                #     bucket[sq] += 1
                # for j in range(2, sq):
                #     if k % j == 0:
                #         bucket[j] += 1
            continue
        if k == 1:
            if res_c % 2 != Ai:
                res_c += 1
                res1.append(k)
            break

        if bucket[k] % 2 != Ai:
            res_c += 1
            res1.append(k)
            for di in d(k):
                bucket[di] += 1
    print(res_c)
    print(*res1)


if __name__ == '__main__':
    main()


### FIXED CODE ###

from collections import defaultdict, deque
import sys

sys.setrecursionlimit(100000)

MIN = -10 ** 9
MAX = 10 ** 9 + 7


def d(n):
    divisors = []
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i * i != n:
                divisors.append(n // i)

    return divisors


def main():
    N = int(input())
    # A = [
    #     int(input())
    #     for _ in range(N)
    # ]
    A = [int(a) for a in input().split()]

    res1 = []
    bucket = [0] * (N + 1)

    i = N
    for Ai in reversed(A):
        i -= 1
        k = i + 1
        if k * 2 > N:
            if Ai == 1:
                res1.append(k)
                bucket[k] = 1

            continue
        if k == 1:
            if len(res1) % 2 != Ai:
                res1.append(k)
            break

        s = 0
        j = 0
        while True:
            j+=1
            if j * k > N:
                break
            s += bucket[j * k]

        if s % 2 != Ai:
            res1.append(k)
            bucket[k] = 1
    print(len(res1))
    print(*res1)


if __name__ == '__main__':
    main()
### BUGGY CODE ###

b,c= map(int, input().split())
a=0
for x in range(b,c+1):
    a=a^x
print(a)


### FIXED CODE ###

def xor(a,b):
    c=a-b+1
    flg1= a%2!=0
    flg2= b%2!=0
    flg3= int((c/2))%2!=0
    if a==b:
        return 1

    if not flg1 and flg2:
        if not flg3:
            return 0
        else:
            return 1
    elif not flg1 and not flg2:
        if not flg3:
            return b
        else:
            return 1^b
    elif flg1 and flg2:
        if not flg3:
            return a
        else:
            return a^1

    elif flg1 and not flg2:
        if not flg3:
            return b
        else:
            return 1^b




a,b = map(int, input().split())
print(xor(0,a-1)^xor(0,b))
### BUGGY CODE ###

import numpy as np

n,k = map(int,input().split())
arr = list(map(int,input().split()))
arr = np.array(arr)

count = 0
mod = 10**9 + 7

for j in range(n):
    for i in range(1,n):
        head = arr[0]
        if head > arr[i]:
            if i+j < n: 
                count += (k*(k+1)//2) % mod
                count %= mod
            else:
                count += (k*(k-1)//2) % mod
                count %= mod
    arr = np.roll(arr, -1)
    
count %= mod
print(count)

### FIXED CODE ###

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

leftCount = 0
rightCount = 0
mod = 10**9 + 7

for i in range(n):
    for j in range(n):
        if arr[i] > arr[j]:
            if i < j:
                rightCount +=1
            else:
                leftCount +=1
leftCount = leftCount*k*(k-1)//2
rightCount = rightCount*k*(k+1)//2
count = (leftCount % mod) + (rightCount % mod)
count %= mod
print(count)
### BUGGY CODE ###

n=int(input())
count=1
for i in range(1,n+1):
  count*=i
print(count%(10**9+7))



### FIXED CODE ###

n=int(input())
count=1
for i in range(1,n+1):
  count*=i
  count%=(10**9+7)
print(count)
### BUGGY CODE ###

import sys
input = sys.stdin.readline

H,W=map(int,input().split())

A=[list(map(int,input().split())) for i in range(H)]
B=[list(map(int,input().split())) for i in range(H)]

SA=[[0]*W for i in range(H)]

for i in range(H):
    for j in range(W):
        SA[i][j]=abs(A[i][j]-B[i][j])

DP=[[] for i in range(W)]

DP[0]=[SA[0][0]]

for i in range(H):
    NDP=[[] for _ in range(W)]
    for j in range(W):
        for k in set(DP[j]):
            if k>=6400:
                continue
            if i+1<H:
                NDP[j].append(k+SA[i+1][j])
                NDP[j].append(abs(k-SA[i+1][j]))
                
            if j+1<W:
                DP[j+1].append(k+SA[i][j+1])
                DP[j+1].append(abs(k-SA[i][j+1]))

    if i==H-1:
        print(min(DP[-1]))
        break
    DP=NDP
                


### FIXED CODE ###

import sys
input = sys.stdin.readline

H,W=map(int,input().split())

A=[list(map(int,input().split())) for i in range(H)]
B=[list(map(int,input().split())) for i in range(H)]

SA=[[0]*W for i in range(H)]

for i in range(H):
    for j in range(W):
        SA[i][j]=abs(A[i][j]-B[i][j])

DP=[[0 for i in range(W)] for j in range(H)]

DP[0][0]=1<<(H+W)*80+SA[0][0]

for i in range(H):
    for j in range(W):
        tempbit=DP[i][j]
        if i+1<H:
            DP[i+1][j]|=tempbit<<SA[i+1][j]
            DP[i+1][j]|=tempbit>>SA[i+1][j]

        if j+1<W:
            DP[i][j+1]|=tempbit<<SA[i][j+1]
            DP[i][j+1]|=tempbit>>SA[i][j+1]

ANS=1<<30
for i in range((H+W)*160+1):
    if 1<<i & DP[-1][-1]!=0:
        ANS=min(ANS,abs(i-(H+W)*80))

print(ANS)
### BUGGY CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *

N = INT()
a = LIST()

lim = 3001
dp = [[0]*lim for _ in range(lim)]
flg = [[0]*lim for _ in range(lim)]

def DFS(i, j):
	if flg[i][j]:
		return dp[i][j]

	if i+1 == j:  #最後の一手
		flg[i][j] = 1
		if N%2:  #先手
			dp[i][j] = a[i]
			return dp[i][j]
		else:    #後手
			dp[i][j] = -a[i]
			return dp[i][j]
	else:
		if (N-(j-i))%2:  #後手
			dp[i][j] = min(DFS(i+1, j)-a[i], DFS(i, j-1)-a[j-1])
			flg[i][j] = 1
			return dp[i][j]
		else:  #先手
			dp[i][j] = max(DFS(i+1, j)+a[i], DFS(i, j-1)+a[j-1])
			flg[i][j] = 1
			return dp[i][j]


print(DFS(0, N))



### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def TUPLE(): return tuple(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7 
#mod = 998244353
from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

N = INT()
a = LIST()

lim = 3001
dp = [[0]*lim for _ in range(lim)]
cnt = 0
for i in range(1, N+1):
	for l in range(N-i+1):
		cnt += 1
		r = l+i
		if (N-i)%2: #後手
			dp[l][r] = min(dp[l+1][r]-a[l], dp[l][r-1]-a[r-1])
		else: #先手
			dp[l][r] = max(dp[l+1][r]+a[l], dp[l][r-1]+a[r-1])

print(dp[0][N])
### BUGGY CODE ###

import numpy as np
from itertools import product

h, w, k = map(int, input().split())
s = np.array([list(map(int, input())) for _ in range(h)], dtype=np.int32)


def hsplit(pat):
    prev = 2
    ret = np.zeros((0, w), dtype=np.int32)
    white = np.zeros(w, dtype=np.int32)
    for i, e in enumerate(pat):
        if e == prev:
            white += s[i]
        else:
            ret = np.vstack([ret, white])
            white = s[i].copy()

        prev = e

    ret = np.vstack([ret, white])

    return ret[1:]


def greedy(arr):
    acc = np.zeros_like(arr, dtype=np.int32)
    ww = arr.shape[1]
    cnt = 0
    for i in range(ww):
        if i == 0:
            acc[:, i] = arr[:, i]
        else:
            acc[:, i] = acc[:, i-1] + arr[:, i]

        if acc[:, i].max() > k:
            cnt += 1
            acc[:, i] = arr[:, i]

    return cnt


ans = float("inf")
for pat in product([0, 1], repeat=h):
    if pat[0]:
        break

    hsp = hsplit(pat)

    if hsp.max() > k:
        continue

    wsp_cnt = greedy(hsp)
    hsp_cnt = hsp.shape[0] - 1

    cnt = hsp_cnt + wsp_cnt
    ans = min(ans, cnt)

print(ans)


### FIXED CODE ###

from itertools import product

h, w, k = map(int, input().split())
s = [list(map(int, input())) for _ in range(h)]

ans = float("inf")
for pat in product([1, 0], repeat=h):
    prev = 2
    sm = -1
    for e in pat:
        if e != prev:
            sm += 1
        prev = e
    #print(pat)
    #print(sm)

    ss = [[0] * w for _ in range(h)]
    for wi in range(w):
        acc = 0
        prev = 2
        for hi, e in enumerate(pat):
            if e != prev:
                acc = 0
            if s[hi][wi]:
                acc += 1
            ss[hi][wi] = acc
            prev = e

    sss = [[0] * w for _ in range(h)]
    for hi in range(h):
        for wi in range(w):
            if wi == 0:
                sss[hi][wi] = ss[hi][wi]
            else:
                sss[hi][wi] = sss[hi][wi-1] + ss[hi][wi]

    base = [0] * h
    cp_prev = [0] * h
    for wi in range(w):
        mx = 0
        cp = [0] * h
        for hi in range(h):
            mx = max(mx, sss[hi][wi] - base[hi])
            cp[hi] = sss[hi][wi]
        if mx > k:
            if wi == 0:
                sm = 10000
            sm += 1
            base = cp_prev
        cp_prev = cp

    ans = min(ans, sm)

print(ans)
### BUGGY CODE ###

# coding: utf-8
# Your code here!

ans = 10**9


def calc(point,num, i):
    global ans
    global G, D
    if point >= G:
        if num < ans:
            ans = num
        return
    if i >= D:
        return
    for j in range(problem[i][0]):
        tmp = point
        for k in range(i, D):
            tmp += (k+1)*100*problem[k][0]+problem[k][1]
        if tmp < G:
            return
        calc(point + (i+1) * 100 * j,num+j, i+1)
    calc(point + (i+1) * 100 * problem[i][0] + problem[i][1],num+problem[i][0], i+1)

D, G=map(int, input().split()) 
problem=[list(map(int,list(input().split()))) for i in range(D)]

calc(0,0,0)

print(ans)



### FIXED CODE ###

# coding: utf-8
# Your code here!
from itertools import product

ans = 10**9

D, G=map(int, input().split()) 
problem=[list(map(int,list(input().split()))) for i in range(D)]

for p in product([True, False], repeat=D):
    
    point = 0
    num = 0
    
    for i in range(D):
        if p[i]:
            point += (i+1) * 100 * problem[i][0] + problem[i][1]
            num += problem[i][0]
            
    if point >= G:
        ans = min(ans, num)
    
    for i in reversed(range(D)):
        if p[i] == False:
            if point >= G:
                ans = min(ans, num)
                break
            for j in range(problem[i][0]):
                point += (i+1) * 100
                num += 1
                if point >= G:
                    break
    if point >= G:
        ans = min(ans, num)
print(ans)
### BUGGY CODE ###

def  main():
    N,K = map(int,input().split())
    ans = 0
    for k in range(K,N):
        for b in range(k+1,N+1):
            cnt = (N-k)//b
            if k!=0:
                cnt += 1
            ans += cnt
    print(ans)    


if __name__ == '__main__':
    main()

### FIXED CODE ###

n,k = map(int,input().split())
count = 0
if k==0:
    print(n ** 2)
    exit()

for i in range(1,n+1):
    if i <= k:
        continue
    count += max(0, (n%i) - k + 1)
    count += (n // i) * (i - k)
print(count)
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

B = sorted(B,reverse=True)
C = sorted(C,reverse=True)
b_list = {-1:0}
for i in range(N):
    for j in range(N):
        if B[i] >= C[j]:
            b_list[i] = j  + b_list[i-1]
            break
        b_list[i] = N + b_list[i-1]
m = 0
for i in range(N):
    for j in range(N-1,-1,-1):
        if B[j] > A[i]:
            m += b_list[j]
            break

print(m)


### FIXED CODE ###

from bisect import bisect_right
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

B = sorted(B)
C = sorted(C)
b_list = {N:0}
for i in range(N-1,-1,-1):
    j = bisect_right(C,B[i])
    b_list[i] = N - j + b_list[i+1]
m = 0
for i in range(N):
    j = bisect_right(B,A[i])
    m += b_list[j]
print(m)
### BUGGY CODE ###

N,K = map(int, input().strip().split(' '))
A = sorted(list(map(int, input().strip().split(' '))), reverse=True)
F = sorted(list(map(int, input().strip().split(' '))))

def argmax(vec):
  max_i = set()
  max_v = 0
  for i, v in enumerate(vec):
    if v > max_v:
      max_v = v
      max_i = {i}
    elif v == max_v:
      max_i.add(i)
  return max_i

while K > 0:
  now_costs = [a*f for a, f in zip(A, F)]
  if max(now_costs) < 1: break
  bottleneck = argmax(now_costs)
  if len(bottleneck) > K: break
  for b in bottleneck:
    A[b] -= 1
  K -= len(bottleneck)
print(max([a*f for a, f in zip(A, F)]))

### FIXED CODE ###

N,K = map(int, input().strip().split(' '))
A = sorted(list(map(int, input().strip().split(' '))), reverse=True)
F = sorted(list(map(int, input().strip().split(' '))))
if sum(A) <= K:
  print(0)
  exit()

ng = 0
ok = max([a*f for a,f in zip(A,F)])
while True:
  if ok-ng == 1: break
  m = int((ng+ok)/2)
  now_cost = 0
  for a,f in zip(A,F):
    now_cost += max(a-(m//f), 0)
  if now_cost <= K:
    ok = m
  else:
    ng = m
    
print(ok)
### BUGGY CODE ###

N = int(input())
r = 1

for n in range(1, N + 1):
    r *= n
print(r % ((10 ** 9) + 7))

### FIXED CODE ###

N = int(input())
r = 1

for n in range(1, N + 1):
    r = (r * n) % ((10 ** 9) + 7)
print(r)
### BUGGY CODE ###

H, W, A, B = map(int,input().split())
P = 10**9+7
#H, W, A, B = map(int,"100000 100000 44444 55555".split())

factlist = [1] * (H+W)
t = 1
for i in range(H+W-1):
	t = (t * (i+1)) % P
	factlist[i+1] = t

def fact(i):
	return factlist[i]

def egcd(a, b):
    if a == 0:
        return (b, 0, 1)
    else:
        g, y, x = egcd(b % a, a)
        return (g, x - (b // a) * y, y)

def modinv(a, m):
    g, x, y = egcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m

def comb(i,j):
	return (fact(i+j) * modinv(fact(i),P) * modinv(fact(j),P)) % P

s = 0
i = 0
while H-A-i-1 >= 0 and B+i <= W and A+i <= H and W-B-i-1 >= 0:
#	print((H-A-i,B+i+1))
	s = (s + comb(H-A-i-1,B+i) * comb(A+i,W-B-i-1)) % P
	i += 1	
print(s)



### FIXED CODE ###

H, W, A, B = map(int,input().split())
P = 10**9+7
# H, W, A, B = map(int,"2 3 1 1".split())

M = H+W-1
factlist = [1] * (H+W)
factinvlist = [1] * (H+W)
t = 1
for i in range(M):
	t = (t * (i+1)) % P
	factlist[i+1] = t
t = pow(factlist[M],P-2,P)
factinvlist[M] = t
for i in range(M):
	t = (t * (M-i)) % P
	factinvlist[M-i-1] = t

def comb(i,j):
	return (factlist[i+j] * factinvlist[i] * factinvlist[j]) % P

s = 0
i = 0
while H-A-i-1 >= 0 and B+i <= W and A+i <= H and W-B-i-1 >= 0:
#	print((H-A-i,B+i+1))
	s = (s + comb(H-A-i-1,B+i) * comb(A+i,W-B-i-1)) % P
	i += 1	
print(s)