Harryxun/stf_run huggingface dataset:
from collections import deque
N = input()
A = [int(input()) for i in range(N)]

res = []
begin = 0
end = len(A) - 1
res = deque()
res.append(A[begin])
res.append(A[end])
begin += 1
end -= 1

### FIXED CODE ###

S = raw_input()

if len(S) == 2:
	print S
elif len(S) == 3:
	print "".join([i for i in reversed(S)])
L,R = map(int,input().split())

ans = 2020

for i in range(L,R + 1):
  l = i % 2019
  r = (i + 1) % 2019
  if l * r < ans:
    ans = l * r
  if r = 0:
    ans = 0
    break
    
print(ans)

### FIXED CODE ###

L,R = map(int,input().split())

ans = 2019 ** 2

if R - L >= 2018:
  ans = 0
  print(ans)
else: 
  for i in range(L,R):
    for j in range(L + 1,R + 1):
      mod = (i * j) % 2019 
      if mod < ans:
        ans = mod
      elif mod == 0:
        ans = 0
        break
  print(ans)
N,M=map(int,input().split())
A=list(map(int,input().split()))
S=sum(A)
l=1/(4*M)
h=0
for i in range(N):
  if A[i]>=l:
    h+=1
  else:
    h+=0
if h=M:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

N,M=map(int,input().split())
A=list(map(int,input().split()))
S=sum(A)
l=S/(4*M)
h=0
for i in range(N):
  if A[i]>=l:
    h+=1
if h>=M:
  print("Yes")
else:
  print("No")
n,m = map(int,input().split())

up = [[] for i in range(n)]
down= [[]for i in range(n)]
for i in range(n+m-1):
    a,b = map(int,input().split())
    a -=1
    b -=1
    up[b].append(a)
    down[a].append(b)

res = [-1]*n
root = -1

for i in range(n):
    if len(up[i])==0:
        res[i] = 0
        root = i
        break

#0なら不使用
used = [0]*n
used[root]=1

#yの親に不使用が一つも存在しなければTrue
def g(y):
    for pe in up[y]:
        if used[pe]==0:
            return False
    return True
    
#zの下のusedとresを埋める
def f(z):
    global used
    global res
    for e in down[z]:
        E = e
        if used[E]==0 and g(E):
            used[E]=1
            res[E]=z+1
            f(E)
f(root)
for i in range(n):
    print(res[i])


### FIXED CODE ###

from collections import deque

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

up = [[] for i in range(n)]
down= [[]for i in range(n)]
for i in range(n+m-1):
    a,b = map(int,input().split())
    a -=1
    b -=1
    up[b].append(a)
    down[a].append(b)

res = [-1]*n
root = -1

for i in range(n):
    if len(up[i])==0:
        res[i] = 0
        root = i
        break

#0なら不使用
used = [0]*n
used[root]=1

#yの親に不使用が一つも存在しなければTrue
def g(y):
    for pe in up[y]:
        if used[pe]==0:
            return False
    return True
    
#zの下のusedとresを埋める
def f(z):
    for e in down[z]:
        if used[e]==0 and g(e):
            res[e]=z+1
            tank2.append(e)
            usedtank.append(e)
c = 1
tank = deque([root])
tank2 = deque([root])
usedtank = []
while c != n:
    tank = tank2
    tank2 = deque([])
    usedtank = []
    while len(tank)!=0:
        f(tank.popleft())
    for usede in usedtank:
        used[usede]=1
    c += len(tank2)
    
for i in range(n):
    print(res[i])
a,b,c = map(int, input().split())
d = int(input())

B-A = (b-a)
C-B = (c-b)
C-A = (c-a)
if B-A <= d and C-B <= d:
    print("Yes")
elif c-a =< d:
    print("Yes") 
else:
    ("No")

### FIXED CODE ###

a,b,c,d = map(int,input().split())
B_A = abs(b - a)
C_B = abs(c - b)
C_A = abs(c - a)
if B_A <= d and C_B <=d:
    print('Yes')
elif C_A <= d:
    print('Yes')
else:
    print('No')
n = input()
ans = []
while n:
  n, r = divmod(n - 1, 26)
  ans.append(chr(ord('a') + r))
ans.reverse()
print(''.join(ans))

### FIXED CODE ###

import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    n = int(input()) - 1
    res = []
    while 1:
        res.append(chr(ord('a') + n % 26))
        n = n // 26 - 1
        if n == -1:
            break

    res.reverse()
    print(''.join(res))
resolve()
N, M = map(int, input().split())

vertices = [[] for i in range(N+1)]
dp = [-1] * (N+1)

for _ in range(M):
    fro, to = map(int, input().split())
    vertices[fro].append(to)

def dfs(i):
    
    if dp[i] != -1:
        return dp[i]
    
    temp = 0
    for vertex in vertices[i]:
        temp = max(temp, dfs(vertex)+1)
        
    dp[i] = temp
    return temp

for i in range(1,N+1):
    dfs(i)
    
print(max(dp))

### FIXED CODE ###

import sys

sys.setrecursionlimit(10**9)

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

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

dp = [-1] * (n+1)
for _ in range(m):
    v1 , v2 = map(int,input().split())
    g[v1].append(v2)
    
# finding longest path for vertice i
def dfs(i):
    if dp[i]!=-1:
        return dp[i]
    temp = 0
    for nv in g[i]:
        temp = max(temp, dfs(nv)+1)

    dp[i]=temp
    return temp
  
# finding overall longest path  
res = 0  
for i in range(1,n+1):
    res = max(res, dfs(i))
print(res)
# 点数計算
def scoring(last_, c, s, t, d, score):
    # score += s[d][t[d]-1]
    score = s[d][t]
    k = 8
    
    for i in range(len(c)):
        # score -= c[i] * (d+1 - last_[d][i])
        # score -= c[i] * (d + 1 - last_[i])
        score -= k * c[i] * (d - last_[i]) + c * (k * (k+1)) / 2
    return score


# input
score = 0
D = int(input())
c = [int(i) for i in input().split()]
s = []
for i in range(D):
    s.append([int(i) for i in input().split()])
# t = []
# for i in range(D):
#     t.append(int(input()))
last = [[0 for i in range(len(c))] for j in range(D+1)] # last[d][i]

ans = []
for d in range(D):
    # last[d][t[d]-1] = d+1
    last_dummy = last[d][:]
    score = 0
    t_d = 0
    for t in range(len(c)):
        last_dummy2 = last_dummy[:]
        last_dummy2[t] = d+1
        if score < scoring(last_dummy2, c, s, t, d, score):
            score = scoring(last_dummy2, c, s, t, d, score)

            t_d = t

    ans.append(t_d)
    last[d][t_d] = d+1


    # last更新
    for i in range(len(c)):
        last[d+1][i] = last[d][i]


[print(ans[i]+1) for i in range(D)]





### FIXED CODE ###

# 点数計算
def scoring(last, c, s, t, d, score):
    # score += s[d][t[d]-1]
    score = s[d][t]
    for i in range(len(c)):
        #score -= c[i] * (d+1 - last[d][i])
        score -= c[i] * (d + 1 - last[i])
    return score


# input
score = 0
D = int(input())
c = [int(i) for i in input().split()]
s = []
for i in range(D):
    s.append([int(i) for i in input().split()])
# t = []
# for i in range(D):
#     t.append(int(input()))
last = [[0 for i in range(len(c))] for j in range(D+1)] # last[d][i]

ans = []
for d in range(D):
    # last[d][t[d]-1] = d+1
    last_dummy = last[d][:]
    score = 0
    t_d = 0
    for t in range(len(c)):
        last_dummy2 = last_dummy[:]
        last_dummy2[t] = d+1
        if score < scoring(last_dummy2, c, s, t, d, score):
            score = scoring(last_dummy2, c, s, t, d, score)
            t_d = t
    ans.append(t_d)
    last[d][t_d] = d+1


    # last更新
    for i in range(len(c)):
        last[d+1][i] = last[d][i]


[print(ans[i]+1) for i in range(D)]
S = input()
if S = ( 'ABC' ):
    print( 'ARC' )
elif S = ( 'ARC' ):
    print( 'ABC' )

### FIXED CODE ###

S = input()
if S ==  'ABC' :
    print( 'ARC' )
elif S ==  'ARC' :
    print( 'ABC' )
n,w=map(int,input().split())
item=[]
for i in range(n):
    tmp=list(map(int,input().split()))
    item.append(tmp)

dp=[[0]*(n+10) for i in range(w+10)]
for i in range(n):
    for j in range(w+1):
        if j >= item[i][0]:
            dp[i+1][j]=max(dp[i][j],dp[i][j-item[i][0]]+item[i][1])
        else:
            dp[i+1][j]=dp[i][j]
print(dp[n][w])

### FIXED CODE ###

n,w=map(int,input().split())
item=[]
for i in range(n):
    tmp=list(map(int,input().split()))
    item.append(tmp)

dp=[[0]*(w+1) for i in range(n+1)]
for i in range(n):
    for j in range(w+1):
        if j >= item[i][0]:
            dp[i+1][j]=max(dp[i][j],dp[i][j-item[i][0]]+item[i][1])
        else:
            dp[i+1][j]=dp[i][j]
print(dp[n][w])
a, b = map(int.input().split())

multi = a * b


if multi % 2 == 0:
    print('Even')
else:
    print('0dd')

### FIXED CODE ###

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

answer = a * b

if answer % 2 == 0:
    print('Even')
else:
    print('Odd')
n,m = map(int,input())
print(int(n*(n-1)/2)+int(m*(m-1)/2))

### FIXED CODE ###

n,m = map(int, input().split())
 
print(int(n*(n-1)/2+m*(m-1)/2))
from collections import Counter
def change_dict_key(d, old_key, new_key, default_value=None):
    d[new_key] = d.pop(old_key, default_value)

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

q=int(input())
for i in range(q):
    b,c=map(int,input().split())
    if b in a_cnt.keys():
        if c in a_cnt.keys():
            a_cnt[c]+=a_cnt[b]
            tmp=a_cnt[b]
            a_cnt.pop(b)
        else:
            change_dict_key(a_cnt,b,c)
    if i==0:
        ans=0
        for key,value in a_cnt.items():
            ans+=key*value
        print(ans)
    else:
        ans+=(c-b)*tmp
        print(ans)

### FIXED CODE ###

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

sum=0
num=[0]*(10**5+1)
for i in range(n):
    sum+=a[i]
    num[a[i]]+=1

q=int(input())
for i in range(q):
    b,c=map(int,input().split())
    sum+=(c-b)*num[b]
    print(sum)
    num[c]+=num[b]
    num[b]=0
a,b = map(int, input().split())
print ("Yes" if a*b%2==1 else “No”)

### FIXED CODE ###

a,b = map(int, input().split())
if a*b % 2 == 1:
  print("Yes")
else:
  print("No")
n,X = map(int,input().split())
x =list(map(int,input().split()))
x.append(X)
x.sort()
a = []
for i in range(n):
  a.append(x[i+1]-x[i])
  
h = min(a)
gcd = 1
for i in range(h,0,-1):
  if h%i == 0:
    if all(a[j]%i == 0 for j in range(n)):
      gcd = i
      break
      
print(gcd)
    

    
    
    


    gcd = i
    break
    
    
print(gcd)
    
  
  




### FIXED CODE ###

n,X = map(int,input().split())
x =list(map(int,input().split()))
x.append(X)
x.sort()
a = []
for i in range(n):
  a.append(x[i+1]-x[i])
  
h = min(a)
gcd = 1
for i in range(h,0,-1):
  if h%i == 0:
    if all(a[j]%i == 0 for j in range(n)):
      gcd = i
      break
      
print(gcd)
from collections import Counter
import bisect
N = int(input())
A = list(map(int,input().split()))



cnt = Counter(A)
A.sort()
ans = 0
P = [0] * (10**6+1)
#print(cnt)
for a in A:
    if P[a]==0
        for i in range(10**7):
            x = a*i
            if x>10**6:
                break
            P[x] = 1
        if cnt[a]==1:
            ans +=1

print (ans)




### FIXED CODE ###

from collections import Counter
import bisect
N = int(input())
A = list(map(int,input().split()))



cnt = Counter(A)
A.sort()
ans = 0
P = [0] * (10**6+1)
#print(cnt)
for a in A:
    if P[a]==0:
        for i in range(10**7):
            x = a*i
            if x>10**6:
                break
            P[x] = 1
        if cnt[a]==1:
            ans +=1

print (ans)
az = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
sum_az = [0 for x in range(26)]

while True:
    x = raw_input()
    x.lower()
    for i in range(26):
        for j in range(len(x)):
            if x[j] == az[i]:
                sum_az[i] += 1
    if x is NONE:
        break

for i in range(26):
    print ("%s : %d" % (az[i], sum_az[i]))
                

### FIXED CODE ###

import sys
az =["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
sum_az = [0 for x in range(26)]

for x in sys.stdin.read().lower():
    for i in range(26):
        if x == az[i]:
            sum_az[i] += 1


for i in range(26):
    print ("%s : %d" % (az[i], sum_az[i]))
A, B = map(int, input().split())
S = input()
if S[:A+1].is_integer() and S[A+1] == '-' and S[A+2:].is_integer():
  print('Yes')
else:
  print('No')

### FIXED CODE ###

def is_int(s):
    try:
        int(s)
        return True
    except ValueError:
        return False

A, B = map(int, input().split())
S = input()
if is_int(S[:A]) and S[A] == '-' and is_int(S[A+1:]):
  print('Yes')
else:
  print('No')
x=input()
if x == 'hi':
	print('Yes')
else if x == 'hihi':
	print('Yes')
else if x == 'hihihi':
	print('Yes')
else if x == 'hihihihi':
	print('Yes')
else if x == 'hihihihihi':
	print('Yes')
else:
	print('NO')

### FIXED CODE ###

x=input()
if x == 'hi':
	print('Yes')
elif x == 'hihi':
	print('Yes')
elif x == 'hihihi':
	print('Yes')
elif x == 'hihihihi':
	print('Yes')
elif x == 'hihihihihi':
	print('Yes')
else:
	print('No')
from fractions import gcd
A,B,C,D=map(int,input().split())


def lcm(x, y):
    return (x * y) // math.gcd(x, y)

size=B

cd=lcm(C,D)
allC=size//C
allD=size//D
allcd=size//cd
ALL=size-(allC+allD-allcd)

size=A-1
cd=lcm(C,D)
pC=size//C
pD=size//D
pcd=size//cd
P=size-(pC+pD-pcd)

print(ALL-P)


### FIXED CODE ###

from fractions import gcd
A,B,C,D=map(int,input().split())


def lcm(x, y):
    return (x * y) // gcd(x, y)

size=B

cd=lcm(C,D)
allC=size//C
allD=size//D
allcd=size//cd
ALL=size-(allC+allD-allcd)

size=A-1
cd=lcm(C,D)
pC=size//C
pD=size//D
pcd=size//cd
P=size-(pC+pD-pcd)

print(ALL-P)
N=int(input())
i=0
j=1
l=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
S=""
while i<N:
    i+=26**j
    j+=1
N-=i-26**(j-1)
for i in reversed(range(j-1)):
    if i!=0:
        a=N//26**i
        S+=l[a]
        N-=a*(26**i)
    else:
        S+=l[N-1]
print(S)
    



    





    






        






    
















        


























            
    


    


    
    














    


    














### FIXED CODE ###

N=int(input())
i=0
j=1
l=['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
S=""
while i<N:
    i+=26**j
    j+=1
N-=i-26**(j-1)
if N==26**(j-1):
    print("z"*(j-1))
    exit()
for i in reversed(range(j-1)):
    if i!=0:
        a=N//26**i
        S+=l[a]
        N-=a*(26**i)
    else:
        S+=l[N-1]
    if N==0:
        S=S[:len(S)-1]
        S+=l[a-1]
        S+="z"*i
        break
print(S)
N,I=map(int,input().split())
print(N-I+


### FIXED CODE ###

n,i=map(int,input().split())
print(n-i+1)
from collections import deque
n = int(input())
tree = [[] for _ in range(n)]
edge = []

for i in range(n - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    tree[a].append(b)
    edge.append((a, b))


# serch max number of color
for i in range(n):
    if i == 0:
        color = len(tree[i])
    else:
        color = max(color, len(tree[i])+1)

upper = [0 for _ in range(n)]

for i in range(n):
    if not tree[i]:
        continue

    top = upper[i]
    tmp = tree[i].copy()
    cnt = 1
    while tmp:
        if cnt == top:
            cnt += 1
        upper[tmp.pop()] = cnt
        cnt += 1

ans = []
for x, y in edge:
    ans.append(upper[y])
print(color)
print(*ans, sep="\n")


### FIXED CODE ###

from collections import deque
n = int(input())
tree = [[] for _ in range(n)]
edge = []

for i in range(n - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    tree[a].append(b)
    edge.append((a, b))


# serch max number of color
for i in range(n):
    if i == 0:
        color = len(tree[i])
    else:
        color = max(color, len(tree[i])+1)

upper = [0 for _ in range(n)]

for i in range(n):
    if not tree[i]:
        continue

    top = upper[i]
    tmp = tree[i].copy()
    cnt = 1
    while tmp:
        if cnt == top:
            cnt += 1
        upper[tmp.pop()] = cnt
        cnt += 1

ans = []
for x, y in edge:
    ans.append(upper[y])
print(color)
print(*ans, sep="\n")
import sys
sys.setrecursionlimit(100000)

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

red = n - blue

waru = 10**9+7

nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]


for i in range(1, blue+1):
    ans = cmb(red+1, i) * cmb(blue-1, i-1)
    print(ans%waru)


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

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

red = n - blue

waru = 10**9+7

def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result


for i in range(1, blue+1, 1):
    if red + 1 < i:
        print(0) 
    else:
        ans = cmb(red+1, i) * cmb(blue-1, i-1)
        #print(i)
        print(ans%waru)
H, W, K = map(int, input().split())
S = [list(input()) for i in range(H)]

non_placed_h = set()
for h in range(H):
    if S[h].count('#') == 0:
        non_placed_h.add(h)

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

for h in range(H):
    if h in non_placed_h:
        continue

    else:
        x_cnt = 0
        x += 1

        for w in range(W):
            if S[h][w] == '#':
                x_cnt += 1
                if x_cnt >= 2:
                    x += 1
            ans[h][w] = x

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

for h in range(1, H):
    for w in range(W):
        if ans[h][w] == 0:
            ans[h][w] = ans[h - 1][w]

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

for h in range(1, H):
    for w in range(W):
        if ans[h][w] == 0:
            ans[h][w] = ans[h - 1][w]

m = float('inf')
for a in ans:
    m = min(m, min(a))

d = m - 1

for i in range(H):
    for j in range(W):
        ans[i][j] -= d

for a in ans:
    print(' '.join(map(str, a)))



### FIXED CODE ###

H, W, K = map(int, input().split())
S = [list(input()) for i in range(H)]

non_placed_h = set()
for h in range(H):
    if S[h].count('#') == 0:
        non_placed_h.add(h)

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

for h in range(H):
    if h in non_placed_h:
        continue

    else:
        x_cnt = 0
        x += 1

        for w in range(W):
            if S[h][w] == '#':
                x_cnt += 1
                if x_cnt >= 2:
                    x += 1
            ans[h][w] = x

for h in range(H - 2, -1, -1):
    for w in range(W):
        if ans[h][w] == 0:
            ans[h][w] = ans[h + 1][w]

for h in range(1, H):
    for w in range(W):
        if ans[h][w] == 0:
            ans[h][w] = ans[h - 1][w]

for h in range(H - 2, -1, -1):
    for w in range(W):
        if ans[h][w] == 0:
            ans[h][w] = ans[h + 1][w]

for h in range(1, H):
    for w in range(W):
        if ans[h][w] == 0:
            ans[h][w] = ans[h - 1][w]

m = float('inf')
for a in ans:
    m = min(m, min(a))

d = m - 1

for i in range(H):
    for j in range(W):
        ans[i][j] -= d

for a in ans:
    print(' '.join(map(str, a)))
N, limit = map(int, input().split())
bounce = int(input().split())
b = [0]
count = 0
for i in range(len(bounce)):
  b.append(b[i]+bounce[i])
  
for j in range(len(b)):
  if b[j] <= limit:
    count += 1
print(count)


### FIXED CODE ###

N, limit = map(int, input().split())
bounce = input().split()
b = [0]
count = 0
for i in range(len(bounce)):
  b.append(b[i]+int(bounce[i]))
  
for j in range(len(b)):
  if b[j] <= limit:
    count += 1
print(count)
import numpy as np


l, r = map(int, input().split())
#if l <= 2019 <= r:
#    print(0)
#    exit()
#elif r*(r-1) <= 2019:
#    print(l*(l+1))
#    exit()

lr = np.arange(l,r+1)
lr = np.reshape(lr, (1,len(lr)))
lr_t = lr.T
mod = (lr*lr_t)%2019
mod = np.triu(mod, k=1)
mod = mod[np.triu_indices(len(mod),k=1)]
print(mod.min())


### FIXED CODE ###

l, r = map(int, input().split())
if l <= 2019 <= r:
    print(0)
    exit()
elif r*(r-1) <= 2019:
    print(l*(l+1))
    exit()

a = 2019
for i in range(l, r):
    for j in range(i+1, r+1):
        a = min(a, i*j%2019)
        if a == 0:
            print(0)
            exit()

print(a)
import functools
import math

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

gcd = []

for i in range(len(A)):
    B = A[i]
    A.pop(i)
    gcd.extend([functools.reduce(math.gcd,A)])
    A.insert(i,B)

print(max(gcd))


### FIXED CODE ###

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

w_min = A[1]

for i in range(w_min,0,-1):
    count = 0
    for j in A:
        if j%i != 0:
            count = count + 1
            if count > 1:
                break
    if count < 2:
        print(i)
        break
import sys
input = sys.stdin.readline
from collections import deque
import heapq
def main():
    N = int(input())
    graph = {}
    for i in range(1, N+1):
        graph[i] = set()
    ans_order = []
    for _ in range(N-1):
        a, b = map(int, input().split())
        graph[a].add(b)
        graph[b].add(a)
        ans_order.append((a, b))
    K = 0
    for i in range(1, N+1):
        K = max(K, len(graph[i]))
    available_colors = deque([i for i in range(1, K+1)])
    not_available_colors = deque([])
    seen = [0 for _ in range(N)]
    seen[0] = 1
    ans = {i: {} for i in range(1, N+1)}
    que = deque([])
    que.append(1)
    pre_edges = deque([])
    while len(que) != 0:
        v = que.popleft()
        pre_edges.append(len(graph[v]))
        for node in graph[v]:
            if seen[node-1] == 1:continue
            seen[node-1] = 1
            col = available_colors.popleft()
            ans[v][node] = col
            not_available_colors.append(col)
            que.append(node)
        if len(pre_edges) > 1:
            restore_count = pre_edges.popleft()
            for _ in range(restore_count):
                if len(not_available_colors) > 0:
                    available_colors.append(not_available_colors.popleft())
    print(K)
    for pair in ans_order:
        a, b = pair
        print(ans[a][b])
if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
class Edge:
    def __init__(self, to, id):
        self.to = to
        self.id = id
N = int(input())
graph = {}
ans = [0] * (N-1)
def dfs(v, c=-1, p=-1):
    global graph, ans
    k = 1
    for edge in graph[v]:
        nv = edge.to
        if nv == p:continue
        if k == c:k += 1
        ans[edge.id] = k
        dfs(nv, k, v)
        k += 1
def main():
    global N, graph, ans
    for i in range(N):
        graph[i] = set()
    for i in range(N-1):
        a, b = map(int, input().split())
        graph[a-1].add(Edge(b-1, i))
        graph[b-1].add(Edge(a-1, i))
    color_count = 0
    for i in range(N):
        color_count = max(color_count, len(graph[i]))
    dfs(0, 0, -1)
    print(color_count)
    for x in ans:
        print(x)
if __name__ == "__main__":
    main()
N, K = map(int, input().split())
S = input()
 
S[K+1] = S[K+1].lower()
 
print(S)

### FIXED CODE ###

N, K = map(int, input().split())
S = input()
 
print(S[:K-1] + S[K-1].lower() + S[K:])
from math import factorial
N,M=list(map(int,input().split()))
dansa=[int(input()) for _ in range(M)]
ans=1
flag=True
if dansa[0]==0:
    print("0")
else:
    if len(dansa)>1:
        for i in range(M-1):
            if dansa[i]+1==dansa[i+1]:
                print("0")
                flag=False
                break
if flag:
    dansa.insert(0,0)
    dansa.append(N)
    for i in range(M+1):
        tmp=dansa[i+1]-dansa[i]-1
        arr=[i for i in range(int(tmp/2)+1)]
        #print("tmp:{}".format(tmp))
        hoge=0
        """
        if tmp%2==0:
            arr=[j*2 for j in range(0,int(tmp/2+1))]
            
        else:
            arr=[j*2+1 for j in range(0,int((tmp+1)/2))]
        """
        #print(arr)
        #if tmp%2==0:
        for k in arr:
            n=tmp-k
            hoge+=factorial(n) / factorial(k) / factorial(n-k)
            
        #print(hoge)
        ans=ans*hoge
        #print(ans)
    print(int(ans%1000000007))
    #print(ans)



### FIXED CODE ###




mod=10**9+7
n,m=list(map(int,input().split()))
a=[int(input()) for _ in range(m)]
fib=[1,1]
c=0
if m>0 and a[0]==1:
    fib[1]=0
    c+=1
for i in range(2,n+1):
    if c<m and a[c]==i:
        fib.append(0)
        c+=1
    else:
        fib.append((fib[i-2]+fib[i-1])%mod)

print(fib[n])