Harryxun/stf_run huggingface dataset:
while True:
    S = raw_input()

    if (S[2] == "?"):
        break

    print eval(S)
    

### FIXED CODE ###

while True:
    S = raw_input()

    if S.split(" ")[1] == "?":
        break

    print eval(S)
n = int(input())
a = list(map(int, input().split()))
ans = 0

a.sort(reverse=True)
a_sum = sum(a[0:len(a):2])
b_sum = sum(a[1:len(a):2])

ans = a_sum-b_sum

print(ans)

### FIXED CODE ###

n,k =map(int, input().split())
l =list(map(int, input().split()))
ans =0

l.sort(reverse=True)
for i in range(k):
    ans += l[i]
print(ans)
n=int(input())
a=sorted(list(map(int,input().split())))
b=sorted(list(map(int,input().split())))
c=sorted(list(map(int,input().split())))
cnt=0
x=[]
i=0
b__=b.copy()
rev=0
while(b__):
     b_=b__.pop()
     while(1):
          try:
               c_=c.pop()
          except:
               rev+=cnt
               x.append(rev)
               cnt=0
               break
          if c_>b_:
               cnt+=1
          else:
               rev+=cnt
               x.append(rev)
               cnt=0
               c.append(c_)
               break
cnt=0
i=n-1
rev=0
while(a):
     a_=a.pop()
     for i in range(1,n+1):
          idx=n-i
          b_=b[idx]
          if b_>a_:
               cnt+=x[i-1]
          else:
               break
print(cnt)

### FIXED CODE ###

n=int(input())
a=sorted(list(map(int,input().split())))
b=sorted(list(map(int,input().split())))
c=sorted(list(map(int,input().split())))
cnt=0
x=[]
i=0
b__=b.copy()
rev=0
while(b__):
     b_=b__.pop()
     while(1):
          try:
               c_=c.pop()
          except:
               rev+=cnt
               x.append(rev)
               cnt=0
               break
          if c_>b_:
               cnt+=1
          else:
               rev+=cnt
               x.append(rev)
               cnt=0
               c.append(c_)
               break
cnt=0
i=n-1
rev=0
ans=0
while(a):
     a_=a.pop()
     while(1):
          try:
               b_=b.pop()
          except:
               rev+=cnt
               ans+=rev
               cnt=0
               break
          if b_>a_:
               cnt+=x.pop(0)
          else:
               rev+=cnt
               ans+=rev
               cnt=0
               b.append(b_)
               break
print(ans)
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    S=list(map(int,list(input())))
    if len(S)%2==0:
        left=len(S)//2-1
        right=len(S)//2
        ans=len(S)//2
        if S[left]==S[right]:
            x=S[left]
            while left>=0 and right<len(S) and S[left]==S[right]==x:
                left-=1
                right+=1
                ans+=1
            if left>=0 and right<len(S) and S[left]!=x or S[right]!=x:
                ans-=1
    else:
        left=len(S)//2-1
        right=len(S)//2+1
        ans=len(S)//2+1
        x=S[len(S)//2]
        if left>=0 and right<len(S) and S[left]==S[right]==x:
            ans+=1
            while left>=0 and right<len(S) and S[left]==S[right]==x:
                left-=1
                right+=1
                ans+=1
            if S[left]!=x or S[right]!=x:
                ans-=1
        elif left>=0 and right<len(S) and S[left]==x or S[right]==x:
            ans+=1
    print(ans)

if __name__ == '__main__':
    main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    S=list(map(int,list(input())))
    N=len(S)
    if N%2==0:
        left=N//2-1
        right=N//2
        ans=N//2
        if S[left]==S[right]:
            x=S[left]
            while left-1>=0 and S[left-1]==x:
                left-=1
            while right+1<N and S[right+1]==x:
                right+=1
            ans+=min(N//2-left,right-N//2+1)
    else:
        left=N//2
        right=N//2
        x=S[N//2]
        ans=N//2+1
        if left-1>=0 and S[left-1]==x:
            while left-1>=0 and S[left-1]==x:
                left-=1
        if right+1<N and S[right+1]==x:
            while right+1<N and S[right+1]==x:
                right+=1
        ans+=min(N//2-left,right-N//2)
    print(ans)

if __name__ == '__main__':
    main()
from collections import defaultdict,deque
import sys
input=sys.stdin.readline
N,M=map(int,input().split())
G=defaultdict(set)
for i in range(M):
  a,b,c=map(int,input().split())
  G[(a-1,c-1)].add((b-1,c-1))
  G[(b-1,c-1)].add((a-1,c-1))
  G[(a-1,-1)].add((a-1,c-1))
  G[(b-1,-1)].add((b-1,c-1))
  G[(a-1,c-1)].add((a-1,-1))
  G[(b-1,c-1)].add((b-1,-1))
def BFS(x):
  d={}
  for k in G.keys():
    d[k]=float("inf")
  d[x]=0
  stack=deque([(x,-1,0)])
  while stack:
    a,c,m=stack.popleft()
    if a==N-1 and c==-1:
      return m
    if d[(a,c)]>m:
      d[(a,c)]=m
      if c>=0:
        for i in G[(a,c)]:
          if d[i]>10**30:
            stack.appendleft((i[0],i[1],m))
      else: 
        for i in G[(a,c)]:
          if d[i]>10**30:
            stack.append((i[0],i[1],m+1))
  return -1

print(BFS(0))



      
    

### FIXED CODE ###

from collections import defaultdict,deque
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
N,M=map(int,input().split())
if M==0:
  print(-1)
  exit()
G=defaultdict(set)
for i in range(M):
  a,b,c=map(int,input().split())
  G[a+(c<<30)].add(b+(c<<30))
  G[b+(c<<30)].add(a+(c<<30))
  G[a].add(a+(c<<30))
  G[b].add(b+(c<<30))
  G[a+(c<<30)].add(a)
  G[b+(c<<30)].add(b)
def BFS(x):
  d={}
  for k in G.keys():
    d[k]=float("inf")
  stack=deque([(x,0)])
  if x not in d:
    return -1
  while stack:
    s,m=stack.popleft()
    if s==N:
      return m
    if d[s]>m:
      d[s]=m
      if s>=(1<<30):
        for i in G[s]:
          if d[i]>10**30:
            stack.appendleft((i,m))
      else: 
        for i in G[s]:
          if d[i]>10**30:
            stack.append((i,m+1))
  return -1

print(BFS(1))
s = input()
s[3] = '8'

print(s)

### FIXED CODE ###

s = input()
s = list(s)
s[3] = '8'

s = ''.join(s)

print(s)
h, w = map(int, input().split())

l = []
ll = [[True for i in range(w)] for j in range(h)]
for _ in range(h):
    s = input()
    cells = list(s)
    # print(cells)
    l.append(cells)
    
# print(l)

for h_i in range(h):
    flag = True
    for w_i in range(w):
        # print(l[h_i][w_i])
        if l[h_i][w_i] == "#":
            flag = False
            break
    if flag:
        for w_i in range(w):
            ll[h_i][w_i] = False

for w_i in range(w):
    flag = True
    for h_i in range(h):
        # print(l[h_i][w_i])
        if l[h_i][w_i] == "#":
            flag = False
            break
    if flag:
        for h_i in range(h):
            ll[h_i][w_i] = False
            
# print(ll)

for i in range(h):
    lll = []a
    for j in range(w):
        # print(l[i][j])
        if ll[i][j]:
            lll.append(l[i][j])
    if len(lll) > 0:
        print(''.join(lll))

### FIXED CODE ###

h, w = map(int, input().split())

l = []
ll = [[True for i in range(w)] for j in range(h)]
for _ in range(h):
    s = input()
    cells = list(s)
    # print(cells)
    l.append(cells)
    
# print(l)

for h_i in range(h):
    flag = True
    for w_i in range(w):
        # print(l[h_i][w_i])
        if l[h_i][w_i] == "#":
            flag = False
            break
    if flag:
        for w_i in range(w):
            ll[h_i][w_i] = False

for w_i in range(w):
    flag = True
    for h_i in range(h):
        # print(l[h_i][w_i])
        if l[h_i][w_i] == "#":
            flag = False
            break
    if flag:
        for h_i in range(h):
            ll[h_i][w_i] = False
            
# print(ll)

for i in range(h):
    lll = []
    for j in range(w):
        # print(l[i][j])
        if ll[i][j]:
            lll.append(l[i][j])
    if len(lll) > 0:
        print(''.join(lll))
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(n, k, as):
    if (n-1)%(k-1)==0:
        return (n-1)/(k-1)
    else:
        return round((n-1)/(k-1))

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_n, str_k] = line.split(' ')
    line = sys.stdin.readline().rstrip()
    as = line.split(' ')
    return (int(str_n), int(str_k), [int(a) for a in as])

def main():
    n, k, as = readQuestion()
    answer = solve(n, k, as)
    print(answer)
    
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(n, k, as1):
    if (n-1)%(k-1)==0:
        return (n-1)//(k-1)
    else:
        return (n-1)//(k-1)+1

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_n, str_k] = line.split(' ')
    line = sys.stdin.readline().rstrip()
    as1 = line.split(' ')
    return (int(str_n), int(str_k), [int(a) for a in as1])

def main():
    n, k, as1 = readQuestion()
    answer = solve(n, k, as1)
    print(answer)
    
if __name__ == '__main__':
    main()
MOD = 998244353
N, S = map(int, input().split())
A = tuple(map(int, input().split()))
table = {0: 1}
for n in range(N):
    next_table = dict()
    for s, now in table.items():
        next_table[s] = (next_table.get(s, 0) + now * 2) % MOD
        if s + A[n] <= S:
            next_table[s + A[n]] = (next_table.get(s + A[n], 0) + now) % MOD
    table = next_table
print(table[S])

### FIXED CODE ###

MOD = 998244353
N, S = map(int, input().split())
A = tuple(map(int, input().split()))
table = [[0] * (S + 1) for _ in range(N + 1)]
table[0][0] = 1
for n in range(N):
    for s in range(S + 1):
        now = table[n][s]
        table[n + 1][s] = (table[n + 1][s] + now * 2) % MOD
        if s + A[n] <= S:
            table[n + 1][s + A[n]] = (table[n + 1][s + A[n]] + now) % MOD
print(table[N][S])
a,b,c=int(input())

if a==b and b==c and c==a:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

a,b,c=map(int, input().split())

if a==b and b==c:
  print('Yes')
else:
  print('No')
x, y, a, b, c = map(int, input().split())
p = sorted(list(map(int, input().split())), reverse=True)
q = sorted(list(map(int, input().split())), reverse=True)
r = sorted(list(map(int, input().split())), reverse=True)

result = sum(p[:x]) + sum(q[:y])
i = 0
red_min = x-1
blue_min = y-1
flag = True

while flag == True:
    if r[i] > p[red_min] or r[i] > q[blue_min]:
        if p[red_min] < q[blue_min]:
            result = result - p[red_min] + r[i]
            i += 1
            red_min -= 1
        else:
            result = result - q[blue_min] + r[i]
            i += 1
            blue_min -= 1
    else:
        flag = False
print(result)
    

### FIXED CODE ###

x, y, a, b, c = map(int, input().split())
p = sorted(list(map(int, input().split())), reverse=True)
q = sorted(list(map(int, input().split())), reverse=True)
r = sorted(list(map(int, input().split())), reverse=True)

p.insert(0, 10**9)
p.append(0)
q.insert(0, 10**9)
q.append(0)
r.append(0)

result = sum(p[1:x+1]) + sum(q[1:y+1])
i = 0
red_min = x
blue_min = y
flag = True

while flag == True:
    if r[i] > p[red_min] or r[i] > q[blue_min]:
        if p[red_min] < q[blue_min]:
            result = result - p[red_min] + r[i]
            i += 1
            red_min -= 1
        else:
            result = result - q[blue_min] + r[i]
            i += 1
            blue_min -= 1
    else:
        flag = False
print(result)
n=int(input())
a=int(input())
print("No") if (n%500) >= a else ptrint("Yes")

### FIXED CODE ###

n=int(input())
a=int(input())
print("No") if (n%500) > a else print("Yes")
num1 = int(input().split())
num2 = list(map(int, input().split()))

sorted(num2, reverse=True)
N=num1[0]
M=num1[1]
A=num2[M-1]

if A<N/M/4:
    print('No')
else:
    print('Yes')

### FIXED CODE ###

n,m = map(int,input().split())
li = list(map(int,input().split()))
  
li.sort(reverse=True)
  
a=li[m-1]
b=sum(li)

if a>=b/4/m:
  print('Yes')
else:
  print('No')
import math
from functools import reduce

N,X=map(int,input().split())
x=list(map(int,input().split()))

def gcd_list(numbers):
    return reduce(math.gcd, numbers)
    
x.append(X)
x.sort()
y=[]

for i in range(len(x)-1):
    y.append(x[i+1]-x[i])
    
print(gcd_list(y))

### FIXED CODE ###

N,X=map(int,input().split())
x=list(map(int,input().split()))

def devidable(numbers,i):
    for number in numbers:
        if number%i: return False
    return True

def gcd(numbers):
    i=min(numbers)
    while True:
        if devidable(numbers,i): return i
        else: i-=1

x.append(X)
x.sort()
y=[]

for i in range(len(x)-1):
    y.append(x[i+1]-x[i])
    
print(gcd(y))
str = input()
num = int(str)
numbers = len(str)
print(numbers)
con = 0
a = str[-6:0]
str = input()
num = int(str)
const = len(str)
numbers = len(str)
even = 0
con = 0
a = str[even:const]
b = int(a)
if numbers%2==1:
    pass
else:
    even += 1
    numbers -= 1
    a = str[even:const]
    b = int("9"*(numbers))
while numbers>0:
    con += (b - 10**(numbers-1) + 1)
    even += 2
    numbers -= 2
    if numbers>0:
        a = str[even:const]
        b = int("9"*(numbers))
print(con)

### FIXED CODE ###

str = input()
num = int(str)
const = len(str)
numbers = len(str)
even = 0
con = 0
a = str[even:const]
b = int(a)
if numbers%2==1:
    pass
else:
    even += 1
    numbers -= 1
    a = str[even:const]
    b = int("9"*(numbers))
while numbers > 0:
    con += (b - 10**(numbers-1) + 1)
    even += 2
    numbers -= 2
    if numbers>0:
        a = str[even:const]
        b = int("9"*(numbers))
print(con)
n = input()
p = input().split()

s = 0
for i in range(n-2):
  if max(int(p[i]), int(p[i+1]), int(p[i+2])) != int(p[i+1]) and min(int(p[i]), int(p[i+1]), int(p[i+2])) != int(p[i+1]):
    s += 1

print(s)

### FIXED CODE ###

n = int(input())
p = input().split()

s = 0
for i in range(n-2):
  if max(int(p[i]), int(p[i+1]), int(p[i+2])) != int(p[i+1]) and min(int(p[i]), int(p[i+1]), int(p[i+2])) != int(p[i+1]):
    s += 1

print(s)
def main():
  x = input()

  if int(x[0:0:-1]) == 3:
    print('bon')
  else:
    if  0 or 1 or 6 or 8 in int(x[0:0:-1]):
      print('pon')
    else:
      print('hon')

main()

### FIXED CODE ###

x = input()
x = x[::-1]
x = int(x[0])


if x == 3:
  print('bon')
else:
  if x == 0 or x == 1 or x == 6 or x == 8:
    print('pon')
  else:
    print('hon')
x = input().split()
W = int(x[0])
H = int(x[1])
x = int(x[2])
y = int(x[3])
r = int(x[4])

if W >= (x + r) and H >= (y + r) and (x - r) >= 0 and (y - r) >= 0:
   print("Yes")
else:
   print("No")

### FIXED CODE ###

xmas = input().split()
W = int(xmas[0])
H = int(xmas[1])
x = int(xmas[2])
y = int(xmas[3])
r = int(xmas[4])

if W >= (x + r) and H >= (y + r) and (x - r) >= 0 and (y - r) >= 0:
   print("Yes")
else:
   print("No")
s=input()
if x=="ABC":
    print("ARC")
else:
    print("ABC")

### FIXED CODE ###

s=input()
if s=="ABC":
    print("ARC")
else:
    print("ABC")
text = ''
while True:
    s = input().lower()
    if s == '':
        break
    text += s
for i in 'abcdefghijklmnopqrstuvwxyz':
    #print(i+' : '+str(s.count(i)))
    print("{0} : {1}".format(i, text.count(i)))

### FIXED CODE ###

text = ''
while True:
    try:
        s = input().lower()
    except EOFError:
        break
    if s == '':
        break
    text += s
for i in 'abcdefghijklmnopqrstuvwxyz':
    print(i+' : '+str(text.count(i)))
    #print("{0} : {1}".format(i, text.count(i)))
n = int(input())
a = list(map(int,input().split()))
b = [[0,0]*n]
c = []
for i in range(n):
    b[i][1] = a[i]
    b[i][0] = i+1
b.sort(key=lambda x:x[1])
for i in range(n):
    c.append(b[i][0])
print(*c)


### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
b = [[0,0] for i in range (n)]
c = []
for i in range(n):
    b[i][1] = a[i]
    b[i][0] = i+1
b.sort(key=lambda x:x[1])
for i in range(n):
    c.append(b[i][0])
print(*c)
A = int(input())
B = int(input())
C = int(input())

if A == 5 and B == 7 and C == 5:
    print("YES")

elif A == 7 and B == 5 and C == 5:
    print("YES")

elif A == 5 and B == 5 and C == 7:
    print("YES")
    
else:
    print("NO")


### FIXED CODE ###

a=input().split()
if a.count('5')==2 and a.count('7')==1:
    print('YES')
else:
    print('NO')
h, w = map(int, input().split())
s = [input() for i in range(h)]

# count min of color change cnt in the path
dp = [[0]*w for i in range(h)]
dp[0][0] = 1 if s[0][0] == '#' else 0
for i in range(w):
    for j in range(h):
        if i==j==0: continue
        a,b = h*w, h*w
        if i>0:
            a = dp[i-1][j] + (1 if s[i-1][j]!=s[i][j] else 0)
        if j>0:
            b = dp[i][j-1] + (1 if s[i][j-1]!=s[i][j] else 0)
        dp[i][j] = min(a,b)
if s[h-1][w-1] == '#':
    dp[h-1][w-1]+=1
print(int(dp[h-1][w-1]/2))

### FIXED CODE ###

def solve():
    h, w = map(int, input().split())
    s = [input() for _ in range(h)]
    INF = 10 ** 9
    dp = [[0]*(w+10) for _ in range(h+10)]
    dp[0][0] = 1 if s[0][0] == '#' else 0

    for i in range(h):
        for j in range(w):
            if not i==j==0:
                dp[i][j] = INF
            if i>0:
                dp[i][j] = min(dp[i][j], dp[i-1][j] + (1 if s[i-1][j]=='.' and s[i][j]=='#' else 0))
            if j>0:
                dp[i][j] = min(dp[i][j], dp[i][j-1] + (1 if s[i][j-1]=='.' and s[i][j]=='#' else 0))

    # for i in range(h):
    #     for j in range(w):
    #         print(dp[i][j], end=' ')
    #     print()
    print(dp[h-1][w-1])


solve()
import numpy as np
main():
  n=6
  a=[int(input()) for i in range(n)]
  dero=np.zeros((25,2))
  for i in range(5):
  for j in range (5):
    dero[i*5+j][0]=a[j]-a[i]
    dero[i*5+j][1]=a[5]
  frag=0
  for i in range(25):
  if dero[i][0]>dero[i][1]:
    frag=1
  if frag==0:
    print("Yay!")
  else:
    print(":(")

### FIXED CODE ###

import numpy as np
n=6
a=[int(input()) for i in range(n)]
dero=np.zeros((25,2))
for i in range(5):
  for j in range (5):
    dero[i*5+j][0]=a[j]-a[i]
    dero[i*5+j][1]=a[5]
frag=0
for i in range(25):
  if dero[i][0]>dero[i][1]:
    frag=1
if frag==0:
  print("Yay!")
else:
    print(":(")
#!/usr/bin/env python
while 1:
    n=int(raw_input())
    if n==0: break
    h1=map(int, raw_input().split())
    for h in h1:
        h2=[ x for x in h1 if x!=h ]
        g=[ h2[i+1]-h2[i] for i in range(n-1) ]
        if len(set(g))==1:
            print h
            break

### FIXED CODE ###

#!/usr/bin/env python
while 1:
    n=int(raw_input())
    if n==0: break
    grass=map(int, raw_input().split())
    for i in range(n+1):
        h=[ x for j,x in enumerate(grass) if i!=j ]
        g=[ h[j+1]-h[j] for j in range(len(h)-1) ]
        if len(set(g))==1:
            print grass[i]
            break
from math import gcd
A, B, C, D = map(int, input().split())
if(A % C == 0):
    c_div = (B // C) - (A // C) + 1
else:
    c_div = (B // C) - (A // C + 1) + 1
if(A % D == 0):
    d_div = (B // D) - (A // D) + 1
else:
    d_div = (B // D) - (A // D + 1) + 1
cd_lcm = (C * D) // gcd(C, D)
cd_div = (B // cd_lcm) - (A // cd_lcm + 1) + 1
print((B - A) - (c_div + d_div - cd_div) + 1)

### FIXED CODE ###

from fractions import gcd
A, B, C, D = map(int, input().split())
if(A % C == 0):
    c_div = (B // C) - (A // C) + 1
else:
    c_div = (B // C) - (A // C + 1) + 1
if(A % D == 0):
    d_div = (B // D) - (A // D) + 1
else:
    d_div = (B // D) - (A // D + 1) + 1
cd_lcm = (C * D) // gcd(C, D)
if(A % cd_lcm == 0):
    cd_div = (B // cd_lcm) - (A // cd_lcm) + 1
else:
    cd_div = (B // cd_lcm) - (A // cd_lcm + 1) + 1
print((B - A) - (c_div + d_div - cd_div) + 1)
a,b,c = map(int,input().split())
if a+b+c>=k22:
  print('bust')
else:
  print('win')

### FIXED CODE ###

a,b,c = map(int,input().split())
if a+b+c>=22:
  print('bust')
else:
  print('win')
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

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


class FactMod():
    '''
    modの値が素数の時のfactと組み合わせを求める
    フェルマーの小定理を用いているため、modが素数以外の時は使えない
    '''

    def __init__(self, n, mod):
        '''
        コンストラクタ
        f:nまでの i!の値を　配列に入れる
        inv: (i!)^-1　の値を配列に入れる
        '''
        self.mod = mod
        self.f = [1]*(n+1)
        for i in range(1, n+1):
            self.f[i] = self.f[i-1]*i % mod

        self.inv = [pow(self.f[-1], mod-2, mod)]
        for i in range(1, n+1)[::-1]:
            self.inv.append(self.inv[-1]*i % mod)
        self.inv.reverse()

    def fact(self, n):
        '''
        n!の値を返す
        '''
        return self.f[n]

    def comb(self, n, r):
        '''
        nCrの値を返す
        '''
        ret = self.f[n] * self.inv[n-r]*self.inv[r]
        ret %= self.mod
        return ret

    def perm(self, n, r):
        """
        nPrの値を返す
        """
        ret = self.f[n] * self.inv[n-r]
        ret %= self.mod
        return ret


X, Y = map(int, input().split())

x = (2*Y-X)/3
y = (2*X-Y)/3
F = FactMod(x+y+1, 10**9+7)

if 0 <= x and x == int(x) and 0 <= y and y == int(y):
    ans = F.comb(x+y, x)
else:
    ans = 0
print(ans)


### FIXED CODE ###


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

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


class FactMod():
    '''
    modの値が素数の時のfactと組み合わせを求める
    フェルマーの小定理を用いているため、modが素数以外の時は使えない
    '''

    def __init__(self, n, mod):
        '''
        コンストラクタ
        f:nまでの i!の値を　配列に入れる
        inv: (i!)^-1　の値を配列に入れる
        '''
        self.mod = mod
        self.f = [1]*(n+1)
        for i in range(1, n+1):
            self.f[i] = self.f[i-1]*i % mod

        self.inv = [pow(self.f[-1], mod-2, mod)]
        for i in range(1, n+1)[::-1]:
            self.inv.append(self.inv[-1]*i % mod)
        self.inv.reverse()

    def fact(self, n):
        '''
        n!の値を返す
        '''
        return self.f[n]

    def comb(self, n, r):
        '''
        nCrの値を返す
        '''
        ret = self.f[n] * self.inv[n-r]*self.inv[r]
        ret %= self.mod
        return ret

    def perm(self, n, r):
        """
        nPrの値を返す
        """
        ret = self.f[n] * self.inv[n-r]
        ret %= self.mod
        return ret


X, Y = map(int, input().split())

x = (2*Y-X)/3
y = (2*X-Y)/3

if 0 <= x and x == int(x) and 0 <= y and y == int(y):
    x = int(x)
    y = int(y)
    F = FactMod(x+y+1, 10**9+7)
    ans = F.comb(x+y, x)
else:
    ans = 0
print(ans)
input_line = input().split(' ')
taka = int(input_line[0])
aoki = int(input_line[1])
numK = int(input_line[2])

for i in range(k):
  if taka >= 1:
    taka -= 1
    continue
  elif aoki >= 1:
    aoki -= 1
    continue
  else:
    break

print(taka + ' ' + aoki)

### FIXED CODE ###

input_line = input().split(' ')
taka = int(input_line[0])
aoki = int(input_line[1])
numK = int(input_line[2])
result = ""
if taka + aoki <= numK:
  result = "0 0"
elif taka >= numK:
  result = str(taka - numK) + " " + str(aoki)
elif taka + aoki > numK:
  result = "0 " + str(taka + aoki - numK)
  
print(result)
strings = ["dream","dreamer","erase","eraser"]

def isDaydream(startindex):
    global S
    if S[startindex:] == "":
        return True
    for string in strings:
        if S[startindex:].startswith(string):
            if(isDaydream(len(string)+startindex)):
                return True
    return False
S = input()
if(isDaydream(0)):
    print("YES")
else:
    print("NO")

### FIXED CODE ###

def isDaydream(s):
    while s != "":
        if s.endswith("dream"):
            s = s[:-5]
        elif s.endswith("dreamer"):
            s = s[:-7]
        elif s.endswith("erase"):
            s = s[:-5]
        elif s.endswith("eraser"):
            s = s[:-6]
        else :
            return False
    return True

if(isDaydream(input())):
    print("YES")
else:
    print("NO")
import heapq

n,m = map(int,input().split())
a = list(map(int,input().split()))
a = map(lambda x:-x, a)
heapq.heapify(a)
print(a)
for _ in range(m):
    temp = -heapq.heappop(a)
    temp//=2

    heapq.heappush(a,-temp)
ans = 0
for _ in range(n):
    ans -= heapq.heappop(a)
print(ans)

### FIXED CODE ###

import heapq

n,m = map(int,input().split())
a = list(map(lambda x: -int(x),input().split()))
heapq.heapify(a)
for _ in range(m):
    temp = -heapq.heappop(a)
    temp//=2
    heapq.heappush(a,-temp)
ans = 0
for _ in range(n):
    ans -= heapq.heappop(a)
print(ans)