Harryxun/stf_run huggingface dataset:
lim = 1e18
n = int(input());
nums = list(map(int,str(input()).split(" ")))
ans = 1
for num in nums:
	ans *= num
    if ans > lim:
    	break
if ans > lim:
	print(-1)
else:
	print(int(ans))


### FIXED CODE ###

def main():
    lim = 1e18
    n = int(input())
    nums = list(map(int,str(input()).split(" ")))
    if 0 in nums:
        print(0)
        return
    ans = 1
    for num in nums:
        ans *= num
        if ans > lim:
            print(-1)
            return
    print(ans)
    return

main()
N, M = map(int, input().split())
L, R = 1, N

def merge(P1, P2):
    L1, R1 = P1
    L2, R2 = P2
    return (max(L1, L2), min(R1, R2))

data = []
for i in range(0, M):
    data.append(map(int, input().split()))
data = sorted(data, lambda x: x[0])

import math
logM = math.floor(math.log2(M))

totyuu = data
# 2つずつくみでしょりしたい
for i in range(0, logM):
    half = []
    if len(totyuu)%2==1:
        half.append(totyuu[-1])
    for j in range(0, int(math.floor(len(totyuu)/2))):
        # じっさいににこずつ
        half.append(merge(totyuu[2*j], totyuu[2*j+1]))
    # halfに半分入っている
    # totyuuをおきかえる
    totyuu = half
data = totyuu

for i in range(0, len(data)):
  tmpL, tmpR = data[i]
  L = max(1, tmpL)
  R = min(tmpR, R)
  if L>R:
    print(0)
    exit()
print(max(0, R-L+1))

### FIXED CODE ###

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

Ls = []
Rs = []
for i in range(0, M):
    l, r = input().split()
    Ls.append(int(l))
    Rs.append(int(r))

maxL = max(Ls)
minR = min(Rs)
result = max(0, minR-maxL+1)

print(result)
import bisect

def dfs(v,l,tr):
  ans[v]=l
  for u in g[v]:
    if checked[u]==0:
      checked[u]=1
      pos=bisect.bisect_left(tr,arr[u])
      if pos==l:
        dfs(u,l+1,tr+[arr[u]])
      elif tr[pos]==arr[u]:
        dfs(u,l,tr)
      else:
        dfs(u,l,tr[:pos]+[arr[u]]+tr[pos+1:])

n=int(input())
arr=[0]+list(map(int,input().split()))
g=[[] for _ in range(n+1)]
for _ in range(n-1):
  a,b=map(int,input().split())
  g[a].append(b)
  g[b].append(a)
ans=[0]*(n+1)
checked=[0]*(n+1)
checked[1]=1
dfs(1,1,[arr[1]])
for i in range(1,n+1):
  print(ans)

### FIXED CODE ###

import bisect
import sys
sys.setrecursionlimit(10**7)

def dfs(v):
  pos=bisect.bisect_left(dp,arr[v])
  changes.append((pos,dp[pos]))
  dp[pos]=arr[v]
  ans[v]=bisect.bisect_left(dp,10**18)
  for u in g[v]:
    if checked[u]==0:
      checked[u]=1
      dfs(u)
  pos,val=changes.pop()
  dp[pos]=val

n=int(input())
arr=[0]+list(map(int,input().split()))
g=[[] for _ in range(n+1)]
for _ in range(n-1):
  a,b=map(int,input().split())
  g[a].append(b)
  g[b].append(a)
ans=[0]*(n+1)
checked=[0]*(n+1)
checked[1]=1
dp=[10**18 for _ in range(n+1)]
changes=[]
dfs(1)
for i in range(1,n+1):
  print(ans[i])
def main():
    h,w=map(int,input().split())
    L=80*(h+w)+1
    a=[list(map(int,input().split())) for i in range(h)]
    b=[list(map(int,input().split())) for i in range(h)]


    x=[[abs(a[i][j]-b[i][j]) for j in range(w)] for i in range(h)]
    

    L=12800
    
    state=[[0 for j in range(w)] for i in range(h)]
    delta=x[0][0]
    state[0][0]=(2**L>>delta)|(2**L<<delta)

    for j in range(1,w):
        delta=x[0][j-1]
        state[0][j]=(state[0][j-1]>>delta)|(state[0][j-1]<<delta)

    for i in range(1,h):
        delta=x[i-1][0]
        state[i][0]=(state[i-1][0]>>delta)|(state[i-1][0]<<delta)

    for i in range(1,h):
        for j in range(1,w):
            delta=x[i][j]
            state[i][j]=(state[i][j-1]>>delta)|(state[i][j-1]<<delta)
            state[i][j]=(state[i-1][j]>>delta)|(state[i-1][j]<<delta)

    
    ans = 10**9
    for i in range(L*2):
        if state[h-1][w-1] & 1:
            ans = min(ans,abs(i-L))
        state[h-1][w-1]>>=1
    print(ans-1)



if __name__ == '__main__':
    main()


### FIXED CODE ###

a=list(map(int,input().split()))
if sum(a)>=22: print('bust')
else: print('win')
print(n**3)

### FIXED CODE ###

N = int(input())
print(N**3)
import heapq
N = int(input())
V = list(map(int, input().split()))
heapq.heapify(V)
for i in range(N-2):
  heapq.heappush((heapq.heappop(V)+heapq.heappop(V))/2)
print(sum(V)/2)

### FIXED CODE ###

a = int(input())
print("red" if a < 3200 else input())
import sys

inp = [int(x) for x in sys.stdin.read().split()]; ii = 0

rows, cols, k = inp[ii:ii+3]; ii += 3
items = [[] for _ in range(rows+1)]
best = [0]*(cols+1)
for _ in range(k):
	inp[ii:ii+3]; ii += 3
	items[r].append([c, v])
for i in range(rows+1):
	items[i].sort()
ans = 0
for r in range(1, rows+1):
	dp = []
	best1, best2 = 0, 0
	Row = items[r]
	for c, v in Row:
		v1 = best[c] + v
		v2 = best1 + v
		v3 = best2 + v
		V = v1
		if V < v2:
			V = v2
		if V < v3:
			V = v3
		dp.append(V)
		if v1 > best1:
			best1 = v1
		if v2 > best2:
			best2 = v2
		if ans < V:
			ans = V
	for j in range(len(dp)):
		if best[Row[j][0]] < dp[j]:
			best[Row[j][0]] = dp[j]
	for j in range(2, cols+1):
		if best[j] < best[j-1]:
			best[j] = best[j-1]
print(ans)


### FIXED CODE ###

rows, cols, k = map(int, input().split())
items = [[] for _ in range(rows+1)]
best = [0]*(cols+1)
for _ in range(k):
	r, c, v = map(int, input().split())
	items[r].append([c, v])
for i in range(rows+1):
	items[i].sort()
ans = 0
for r in range(1, rows+1):
	dp = []
	best1, best2 = 0, 0
	Row = items[r]
	for c, v in Row:
		v1 = best[c] + v
		v2 = best1 + v
		v3 = best2 + v
		V = max(v1, v2, v3)
		dp.append(V)
		if v1 > best1:
			best1 = v1
		if v2 > best2:
			best2 = v2
		if ans < V:
			ans = V
	for j in range(len(dp)):
		if best[Row[j][0]] < dp[j]:
			best[Row[j][0]] = dp[j]
	for j in range(2, cols+1):
		if best[j] < best[j-1]:
			best[j] = best[j-1]
print(ans)
A=input()
B=input()
C=input()
D=input()
a=int(A)
b=int(B)
c=int(C)
d=int(D)

if a < c :
    max=c
else :
    max=a
    
if b > d :
    min=d
else :
    min=b
if ( min - max ) > 0 :
    print( min - max )
    print('\n')
else :
    print('0\n')

### FIXED CODE ###



a,b,c,d=[int(i) for i in input().strip().split(' ')]

'''
入力は他の人のを見た
'''

max=0
min=0

if a < c :
    max=c
else :
    max=a
    
if b > d :
    min=d
else :
    min=b
if ( min - max ) > 0 :
    print( min - max )
else :
    print(0)
num = int(input())
str2 = input().split(" ")
nums = [int(s) for s in str2]
nums.sort()

for i in range(len(nums)):
    ans = ans * nums[i]
    if(ans > 1000000000000000000):
        print(-1)
        quit()
print(ans)
quit()

### FIXED CODE ###

num = int(input())
str2 = input().split(" ")
nums = [int(s) for s in str2]
nums.sort()

ans = 1

for i in range(len(nums)):
    ans = ans * nums[i]
    if(ans > 1000000000000000000):
        print(-1)
        quit()
print(ans)
import numpy as np
    
strong_order = np.array([14,2,3,4,5,6,7,8,9,10.11,12,13])

A,B = [int(i)-1 for i in input().split()]

if strong_order[A] > strong_order[B]:
    print("Alice")
elif strong_order[A] < strong_order[B]:
    print("Bob")
else:
    print("Draw")
    
    

### FIXED CODE ###

import numpy as np
    
strong_order = np.array([14,2,3,4,5,6,7,8,9,10,11,12,13])

A,B = [int(i)-1 for i in input().split()]

if strong_order[A] > strong_order[B]:
    print("Alice")
elif strong_order[A] < strong_order[B]:
    print("Bob")
else:
    print("Draw")
n= int(input())
k = int(input())
z = 1
for i in range(n):
  if z < k:
    z = 2Z
  else:
    z = z+k
print(z)

### FIXED CODE ###

n= int(input())
k = int(input())
z = 1
for i in range(n):
  if z < k:
    z = 2*z
  else:
    z = z+k
print(z)
import sys


def jump(k, h, res):
  if not k:
    return 0

  if res[k] == -1:
    res[k] = jump(k-1, h, res) + abs(h[k] - h[k-1])
    if k >= 2:
      res[k] = min(res[k], jump(k-2, h, res) + abs(h[k] - h[k-2]))

  return res[k]


def main(N, H):
  res = [-1] * N

  print jump(N-1, H, res)


if __name__ == '__main__':
  H, N = None, None
  for i, line_ in enumerate(sys.stdin):
    line = line_.strip()
    if line:
        if not i:
            N = int(line.strip())
        H_ = line.strip().split()
        H = [int(num) for num in H_]
  if N and H:
    main(N, H)

### FIXED CODE ###

import sys


def jump(n, h, res):
  res[0] = 0
  res[1] = abs(h[0] - h[1])
  for i in range(2, len(res)):
      res[i] = min(res[i-1] + abs(h[i] - h[i-1]), res[i-2] + abs(h[i] - h[i-2]))

  return res[n]


def main(N, H):
  res = [0] * N

  print jump(N-1, H, res)


if __name__ == '__main__':
  H, N = None, None
  for i, line_ in enumerate(sys.stdin):
    line = line_.strip()
    if line:
        if not i:
            N = int(line.strip())
        H_ = line.strip().split()
        H = [int(num) for num in H_]
  if N is not None and H is not None:
    main(N, H)
from sys import stdin

a,b,c=map(int,input().split())
print(str(c)+" "+str(a)+" "str(c))

### FIXED CODE ###

from sys import stdin

a,b,c=map(int,input().split())
print(str(c)+" "+str(a)+" "+str(b))
a,b=map(int,input().split())
n=b-a
print(n(n+1)//2-b)

### FIXED CODE ###

a,b=map(int,input().split())
n=b-a
print(n*(n+1)//2-b)
n = input()
lis = []
ans = 0
for i in xrange(n):
    com = raw_input()
    if   com[0] == 'i':
        lis.append(com[7:])
    elif com[6] == ' ':
        try:
            lis.pop(~lis[::-1].index(com[7:]))
        except:
            pass
    elif com[6] == 'F':
        lis.pop()
    else:
        bot += 1
 
print ' '.join( map(str, reversed(lis[ans:])) )

### FIXED CODE ###

n = input()
lis = []
ans = 0
for i in xrange(n):
    com = raw_input()
    if   com[0] == 'i':
        lis.append(com[7:])
    elif com[6] == ' ':
        try:
            lis.pop(~lis[::-1].index(com[7:]))
        except:
            pass
    elif com[6] == 'F':
        lis.pop()
    else:ans += 1
 
print ' '.join( map(str, reversed(lis[ans:])) )
n = int(input())
S = input()

ans=[]
for i in range(len(S)):
  s = S[i]
  sind = ord('A') + (ord(s)-ord('A')+ n)%26
  ans.append(chr(sind))

print(ans)

### FIXED CODE ###

import numpy as np
s = input()
slist = np.array(['SUN','MON','TUE','WED','THU','FRI','SAT'])
i = np.where(slist==s)[0][0]

print(7-i)
x, y, z, N = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

Q = [[0,0,0]]
i,j,k = Q[0]
P = [A[i]+B[j]+C[k]]

def next(P,Q, cnt):
    if len(P)<0 or cnt==N:
        return
    p = P.pop(0)
    print(p)
    i,j,k = Q.pop(0)
    if i+1<x:
        P.append(A[i+1] + B[j] + C[k])
        Q.append([i+1,j,k])
    if j+1<y:
        P.append(A[i] + B[j+1] + C[k])
        Q.append([i,j+1,k])
    if k+1<z:
        P.append(A[i] + B[j] + C[k+1])
        Q.append([i,j,k+1])
    ids = sorted(range(len(P)), key=lambda k:P[k], reverse=True)
    tmp = [Q[id] for id in ids]
    Q = tmp
    P.sort(reverse=True)
    next(P, Q, cnt+1)
        

next(P, Q, 0)

### FIXED CODE ###

X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

ans_list = []
for x,a in enumerate(A):
    for y,b in enumerate(B):
        if (x+1)*(y+1)>K:
                break
        for z,c in enumerate(C):
            if (x+1)*(y+1)*(z+1)>K:
                break
            ans_list.append(a+b+c)

ans_list.sort(reverse=True)

for ans in ans_list[:K]:
    print(ans)
num=int(input())
    a_array=[]
    b_array=[]
    for n in range(2*num):
        elem=[int(n) for n in input().split()]
        if n < num:
            a_array.append(elem)
        else:
            b_array.append(elem)
    a_array.sort(key=lambda x:x[1])
    a_array.reverse()
    b_array.sort(key=lambda x: x[0])
    answer=0
    for b_x, b_y in b_array:
        for a_x, a_y in a_array:
            if b_x > a_x and b_y > a_y:
                answer=answer+1
                a_array.remove([a_x,a_y])
    print(answer)

### FIXED CODE ###

num=int(input())
a_array=[]
b_array=[]
for n in range(2*num):
    elem=[int(n) for n in input().split()]
    if n < num:
        a_array.append(elem)
    else:
        b_array.append(elem)
a_array.sort(key=lambda x:x[1])
a_array.reverse()
b_array.sort(key=lambda x: x[0])
answer=0
for b_x, b_y in b_array:
    for a_x, a_y in a_array:
        if b_x > a_x and b_y > a_y:
            answer=answer+1
            a_array.remove([a_x,a_y])
            break;
print(answer)
S = input().split()
A = S[0]
B = S[1]
C = S[2]
K = S[3]

if K <= A:
  print(K)
elif K-A <= B:
  print(K)
else:
  print(K-C)

### FIXED CODE ###

S = list(map(int,input().split()))
A = S[0]
B = S[1]
C = S[2]
K = S[3]

if K <= A:
  print(K)
elif K <= A+B:
  print(A)
else:
  print(A-(K-A-B))
#input
n, k = map(int, input().split())

#output
mod = pow(10, 9) + 7

def cmb(n, r):
    res = 1
    fac = 1
    for i in range(r):
        res *= (n-i)
        res %= mod
        fac *= (i+1)
        fac %= mod
    return res*pow(fac, mod-2, mod) % mod

if n <= k-1:
    print(cmb(2*n-1, n))
else:
    answer = 0
    for m in range(k+1):
        answer += cmb(n, m)*cmb(n-1, a) % mod

print(answer % mod)

### FIXED CODE ###

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

#output
mod = pow(10, 9) + 7

n_ = 4*10**5 + 5
fun = [1]*(n_+1)
for i in range(1,n_+1):
    fun[i] = fun[i-1]*i%mod
rev = [1]*(n_+1)
rev[n_] = pow(fun[n_],mod-2,mod)
for i in range(n_-1,0,-1):
    rev[i] = rev[i+1]*(i+1)%mod
def cmb(n,r):
    if n <= 0 or r < 0 or r > n: return 0
    return fun[n]*rev[r]%mod*rev[n-r]%mod

if n <= k-1:
    print(cmb(2*n-1, n))
else:
    answer = 0
    for m in range(k+1):
        answer += cmb(n, m)*cmb(n-1, m) % mod
        answer %= mod
    print(answer)
from collections import defaultdict
from bisect import bisect_left
N, K = map(int, input().split())
a = [int(c)-1 for c in input().split()]
s = [0]
for i in range(N):
  s += [(s[-1]+a[i])%K]
dic = defaultdict(list)

for i in range(N+1):
  dic[s[i]] += [i]

ans = 0
for k in dic.keys():
  ls = dic[k]
  for j in range(len(ls)):
    ind = bisect_left(ls, ls[j]-K+2)
    ans += j-ind
    if ind>0 and ls[ind-1]+1 == ls[ind]:
      ans += 1
    elif ind<ls[0]:
      ans += 1
#  print(k, ans)

print(ans)

### FIXED CODE ###

from collections import defaultdict
import itertools

N, K = map(int, input().split())
A = [int(c)-1 for c in input().split()]
A = [0] + A
Acum = list(itertools.accumulate(A))
Acum = [x%K for x in Acum]

counter = defaultdict(int)

ans = 0
for i,x in enumerate(Acum):
  ans += counter[x]
  counter[x] += 1
  if i>=K-1:
    counter[Acum[i-K+1]] -= 1
print(ans)
n, m = list(int, input().split())
if n == m:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    n, m = LI()
    if n == m:
        print("Yes")
    else:
        print("No")

main()
n=input()
nums=list(map(int,input().split()))

ans = 1
over = 10**18

for num in nums:
    ans = ans * num
    if ans > over:
        print(-1)
        exit()

print(ans)


### FIXED CODE ###

A,B=map(int,input().split())
print(A*B)
n, k = map(int, input().split())
s = input()
s_split_0 = s.split("1")
s_split_1 = s.split("0")

s_split_1= [len(i) for i in s_split_1 if i!=""]
s_split_0= [len(i) for i in s_split_0 if i!=""]

if s[0]=="1":
    print(max([sum(s_split_0[i:i+k])+sum(s_split_1[i:i+k+1]) for i in range(len(s_split_0)-k+1)]))
else:
    print(max([sum(s_split_0[i:i+k+1])+sum(s_split_1[i:i+k]) for i in range(len(s_split_1)-k+1)]))


### FIXED CODE ###

import sys
input =  sys.stdin.readline

n, k = map(int, input().split())
s = input()+'-1'

cnt = 0
cnt_list = []
for i in range(n):
    if s[i] == s[i+1]:
        cnt += 1
    else:
        cnt_list.append(cnt+1)
        cnt = 0

# print(cnt_list)


l = 0
r = 2*k
ma = 0
su = 0
if s[0] == '0':
    r = 2*k
else:
    r = 2*k+1
su = sum(cnt_list[l:r])
while l < r:
    if ma < su:
        ma = su
    if l == 0 and r == 2*k:
        l += 1
        su -= cnt_list[l-1]
    else:
        l += 2
        su -= sum(cnt_list[l-2:l])
    r += 2
    su += sum(cnt_list[r-2:r])
    if r >= len(cnt_list):
        r = len(cnt_list)
    
print(ma)
a, op, b = map(int, input().split())
if op == '+':
  print(a+b)
else:
  print(a-b)

### FIXED CODE ###

a, op, b = input().split()
a = int(a)
b = int(b)
op = str(op)

if op == '+':
  print(a+b)
else:
  print(a-b)
N, K = map(int, input().split())
A = list(map(int, input().split()))

dic = {}
for i, v in enumerate(A):
    dic[i+1] = v

town = 1
s = set()
l = []
for _ in range(K):
    l.append(town)
    s.add(town)
    town = dic[town]
    if town in s:
        stop_twon = town
        break

list_first_split = l[:l.index(stop_twon)]
list_second_split = l[l.index(stop_twon):]
print(list_second_split[(K - (len(list_first_split))) % len(list_second_split)])

### FIXED CODE ###

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

dic = {}
for i, v in enumerate(A):
    dic[i+1] = v

town = 1
s = set()
l = []
for _ in range(K):
    l.append(town)
    s.add(town)
    town = dic[town]
    if town in s:
        stop_twon = town
        break
if N <= K:
    list_first_split = l[:l.index(stop_twon)]
    list_second_split = l[l.index(stop_twon):]
    print(list_second_split[(K - (len(list_first_split))) % len(list_second_split)])
else:
    print(town)
def gcd(a,b):
    if b==0:
        return a
    else:
        gcd(b,a%b)


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

if n==1:
    a=int(input())
    print(abs(a-x))
    exit()
else:
    str=input()
    lst=str.split(" ")
    a=int(lst[0])
    b=int(lst[1])
    maxim=gcd(abs(a-x),abs(b-x))
    for i in range(2,n):
        c=int(lst[i])
        maxim=gcd(maxim,abs(c-x))
print(maxim)


### FIXED CODE ###

def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)


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

if n==1:
    a=int(input())
    print(abs(a-x))
    exit()
else:
    str=input()
    lst=str.split(" ")
    a=int(lst[0])
    b=int(lst[1])
    maxim=gcd(abs(a-x),abs(b-x))
    for i in range(2,n):
        c=int(lst[i])
        maxim=gcd(maxim,abs(c-x))
print(maxim)
s = input()
t = input()

ans = "UNRESTORABLE"

memo = -1

for i in range(len(s)):
    for j in range(len(t)):
        count = 0
        if s[i+j] == t[j] or t[j] == "?":
            count += 1
        else:
            count = 0
            break
        if count == len(t):
            ans = s[i:i+len(t)]
            memo = i
            count = 0

if ans == "UNRESTORABLE":
    print(ans)
else:
    ans1 = ""
    for word in t:
        if word == "?":
            ans1 += "a"
        else:
            ans1 += word
    ans1[memo:memo+len(t)] = ans
    print(ans1)
        


### FIXED CODE ###

s = input()
t = input()

ans = "UNRESTORABLE"

memo = -1

for i in range(len(s) - len(t) + 1):
    count = 0
    for j in range(len(t)):
        if s[i+j] == t[j] or s[i+j] == "?":
            count += 1
        else:
            break
        if count == len(t):
            ans = t
            memo = i

if ans == "UNRESTORABLE":
    print(ans)
else:
    ans1 = ""
    for word in s:
        if word == "?":
            ans1 += "a"
        else:
            ans1 += word
    ans2 = ans1[0:memo] + ans + ans1[memo+len(t):]
    print(ans2)
def cul_num(key):
    if key == 0:
        return 0
    if key <= 2:
        return 1
    if key == 3:
        return 2
    return cul_num(key-1)+cul_num(key-2)+1

n, m = map(int, input().split())
a = []
res = 1

[a.append(int(input())) for _ in range(m)]
a.append(n+1)

for index,i in enumerate(a):
    if i == a[0]:
        res *= cul_num(i)
    else:
        res *= cul_num(i-a[index-1]-1)
    if res > 1000000007:
        res = res % 1000000007

print(res)


### FIXED CODE ###

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

b = [0]*(n+2)
b[0] = 1

for i in range(m):
    b[int(input())] = -1

for i in range(n):
    if b[i] != -1:
        if b[i+1] != -1:
            b[i+1] += b[i]
        if b[i+2] != -1:
            b[i+2] += b[i]
        b[i] %= 1000000007

print(b[n]%1000000007)
from collections import defaultdict
from math import gcd
N = int(input())
MOD = 10**9 + 7
L = defaultdict(lambda: [0,0])
for _ in range(N):
    A, B = map(int, input().split())
    d = gcd(A,B)
    A, B = A//d, B//d
    if A<0:
        A, B = -A, -B
    if B>=0:
        L[(A,B)][0] += 1
    else:
        L[(-B,A)][1] += 1
res = 1
for x,y in L.values():
    res *= pow(2,x,MOD) + pow(2,y,MOD) -1
    res %= MOD
print(res-1)

### FIXED CODE ###

from collections import defaultdict
from math import gcd
N = int(input())
MOD = 10**9 + 7
L = defaultdict(lambda: [0,0])
zero = 0
for _ in range(N):
    A, B = map(int, input().split())
    if A==0: d=B
    elif B==0: d=A
    else: d=gcd(A,B)
    if d != 0:
        A, B = A//d, B//d
        if A<0: A, B = -A, -B
        if B>0: L[(A,B)][0] += 1
        else: L[(-B,A)][1] += 1
    else: zero += 1
res = 1
for x,y in L.values():
    res *= pow(2,x,MOD) + pow(2,y,MOD) -1
    res %= MOD
print((res+zero-1)%MOD)
c=input()
print chr(ord(c) + 1)

### FIXED CODE ###

c=input()
a=[chr(i) for i in range(97, 97+26)]
print(a[a.index(c)+1])
#リストAの丸太を全てx以下にK回以内の切る回数で揃えることができるかを判断する関数。
def can_or_cannot(A,K,x):
    kaisuu_sum = 0
    for i in range(len(A)):
        if A[i]%x == 0:
            temp = (A[i]//x) - 1
            kaisuu_sum += temp
        else:
            temp = A[i]//x
            kaisuu_sum += temp

        if kaisuu_sum > K:
            return 'No'

    return 'Yes'

def main():
    N,K = map(int,input().split())
    A = list(map(int,input().split()))
    A.sort()
    #二分探索するよ
    left = 0
    right = A[N-1]
    if right == 1:
        return 1
    mid = 0
    while True:
        mid = int( (left + right)/2 )
        #print(left,mid,right)
        judge = can_or_cannot(A,K,mid)
        #print(left,mid,right,judge)
        if judge == 'No':
            left = mid+1
        elif judge == 'Yes':
            right = mid

        if left == right:
            #print(left,mid,right)
            return right

print(main())


### FIXED CODE ###

#リストAの丸太を全てx以下にK回以内の切る回数で揃えることができるかを判断する関数。
def can_or_cannot(A,K,x):
    kaisuu_sum = 0
    for i in range(len(A)):
        if A[i]%x == 0:
            temp = (A[i]//x) - 1
            kaisuu_sum += temp
        else:
            temp = A[i]//x
            kaisuu_sum += temp

        if kaisuu_sum > K:
            return 'No'

    return 'Yes'

def main():
    N,K = map(int,input().split())
    A = list(map(int,input().split()))
    A.sort()
    #二分探索するよ
    left = 0
    right = A[N-1]

    if right == 1:
        return 1

    mid = 0
    while True:
        if right == 1:
            return 1
            
        mid = int( (left + right)/2 )
        #print(left,mid,right)
        judge = can_or_cannot(A,K,mid)
        #print(left,mid,right,judge)
        if judge == 'No':
            left = mid+1
        elif judge == 'Yes':
            right = mid

        if left == right:
            #print(left,mid,right)
            return right

print(main())