Harryxun/stf_run huggingface dataset:
N,A,B,C=map(int,input().split(' '))
S = [input() for i in range(N)]
ans = []
if A+B+C==0:
    print('No')
else:
    d = {"A":A,"B":B,"C":C}
    for n,i in enumerate(S):
        l,r=list(i)
        L,R=d[l],d[r]
        if L==R==0:
            print('No')
            exit()
        elif L==0:
            ans.append(l)
            d[l] +=1
            d[r] -=1
        elif R==0:
            d[l] -=1
            d[r] +=1
            ans.append(r)
        elif L==R==1 and n != N-1 and i != S[n+1]:
            if l in S[n+1]:
                d[l] +=1
                d[r] -=1
                ans.append(l)
            else:
                d[l] -=1
                d[r] +=1
                ans.apppend(r)
        else:
            if L>=R:
                d[l] -=1
                d[r] +=1
                ans.append(r)
            else:
                d[l] +=1
                d[r] -=1
                ans.append(l)
print('Yes')
for i in ans:
    print(i)

### FIXED CODE ###

N,A,B,C=map(int,input().split(' '))
S = [input() for i in range(N)]
ans = []
if A+B+C==0:
    print('No')
else:
    d = {"A":A,"B":B,"C":C}
    for n,i in enumerate(S):
        l,r=list(i)
        L,R=d[l],d[r]
        if L==R==0:
            print('No')
            exit()
        elif L==0:
            ans.append(l)
            d[l] +=1
            d[r] -=1
        elif R==0:
            d[l] -=1
            d[r] +=1
            ans.append(r)
        elif L==R==1 and n != N-1 and i != S[n+1]:
            if l in S[n+1]:
                d[l] +=1
                d[r] -=1
                ans.append(l)
            else:
                d[l] -=1
                d[r] +=1
                ans.append(r)
        else:
            if L>=R:
                d[l] -=1
                d[r] +=1
                ans.append(r)
            else:
                d[l] +=1
                d[r] -=1
                ans.append(l)
    print('Yes')
    for i in ans:
        print(i)
K = list(map(int, J.strip()))
D = int(input())
mod = 10**9+7
a = 0
for i in range(1, J+1):
    if sum(map(int, str(i))) % D == 0:
        a += 1
print(a%mod)
dp = [0]*D
dp[0] += 1
S = 0
for k in K:
    dp[S%D] -= 1
    dp2 = [0]*(D+10)
    for j, d in enumerate(dp):
        dp2[j] += d
        dp2[j+10] -= d
    for j in range(1, D+10):
        dp2[j] = (dp2[j-1] + dp2[j]) % mod
    for j in range(10):
        dp2[(D+j)%D] = (dp2[(D+j)%D] + dp2[D+j]) % mod 
    dp = dp2[:D]
    for j in range(k+1):
        dp[(S+j)%D] = (dp[(S+j)%D] + 1)%mod
    S += k
print((dp[0]-1)%mod)


### FIXED CODE ###

K = list(map(int, input().strip()))
D = int(input())
mod = 10**9+7

dp = [0]*D
dp[0] += 1
S = 0
for k in K:
    dp[S%D] -= 1
    dp2 = [0]*(D+10)
    for j, d in enumerate(dp):
        dp2[j] += d
        dp2[j+10] -= d
    for j in range(1, D+10):
        dp2[j] = (dp2[j-1] + dp2[j]) % mod
    for j in range(10):
        dp2[(D+j)%D] = (dp2[(D+j)%D] + dp2[D+j]) % mod 
    dp = dp2[:D]
    for j in range(k+1):
        dp[(S+j)%D] = (dp[(S+j)%D] + 1)%mod
    S += k
print((dp[0]-1)%mod)
S = input()
Q = int(input())

for _ in range(Q):
    q = input()
    if len(q) == 1:
        S.reverse()
    else:
        T, F, C = q.split()
        if int(F) == 1:
            S = C + S
        else:
            S = S + C

print(S)


### FIXED CODE ###

from collections import deque

S = list(input())
Q = int(input())

d = deque(S)
head = "l"

for _ in range(Q):
    q = input()
    if len(q) == 1:
        if head == "l":
            head = "r"
        else:
            head = "l"
    else:
        T, F, C = q.split()
        if int(F) == 1:
            if head == "l":
                d.appendleft(C)
            else:
                d.append(C)
        else:
            if head == "l":
                d.append(C)
            else:
                d.appendleft(C)
if head == "l":
    print("".join(list(d)))
else:
    print("".join(list(d)[::-1]))
A,B = map(int(input().split()))
if A>=13:
  print(B)
elif A>=6:
  print(B/2)
else:
  print(0)

### FIXED CODE ###

A,B = map(int,input().split())
if A>=13:
  print(B)
elif A>=6:
  print(int(B/2))
else:
  print(0)
import itertools

def solve():
    n = int(input())
    A = list(set(map(int, input().split(" "))))
    sum_list = []
    for i in range(1, n + 1):
        for ele in list(itertools.combinations(A, i)):
            sum_list.append(sum(ele))

    sum_list.sort()
    length = len(sum_list)
    print(sum_list[length // 2])

solve()

### FIXED CODE ###

def LI(): return [int(x) for x in input().split(" ")]
def LS(): return [str(x) for x in input().split(" ")]
def ItoS(L): return [str(x) for x in L]
def StoI(L): return [int(c) for c in L]

def solve():
    while 1:
        try:
            n, a, b = LI()
            if abs(a - b) % 2:
                print("Borys")
            else:
                print("Alice")

            break
        except:
            break
solve()
import fractions
n = int(input())
a = list(map(int, input().split()))
v = fractions.gcd(a[0], a[1])
for i in range(2, n):
    v = math.gcd(v, a[i])
print(v)


### FIXED CODE ###

import fractions
n = int(input())
a = list(map(int, input().split()))
v = fractions.gcd(a[0], a[1])
for i in range(2, n):
    v = fractions.gcd(v, a[i])
print(v)
X, Y = map(int, input().split())

for i in range(X+1):
    if Y == (2 * i + 4 * (X - T)):
        print('Yes')
        exit()
else:
    print('No')

### FIXED CODE ###

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

for i in range(X+1):
    if Y == (2 * i + 4 * (X - i)):
        print('Yes')
        exit()
else:
    print('No')
def main():
    N, K = list(map(int, input().split(' ')))
    Ai = list(map(int, input().split(' ')))
    # print(Ai)
    P = []
    prev = 0
    now = 0
    
    S = [1]
    for index, i in enumerate(range(len(Ai)-K*2, len(Ai))):
        S.append(S[index] * Ai[i])
    # print(S, len(S))
    
    for n in range(K-1,N-1):
        # print(n, S[n], n-K, S[n-K])
        a1 = S[n] // S[n-K]
        a2 = S[n+1] // S[n-K+1]
        
        if a2 > a1:
            print('Yes')
        else:
            print('No')
        

main()

### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
 
for i in range(N - K):
  score_2 = A[i+K]
  score_1 = A[i]
  print('Yes' if score_1 < score_2 else 'No')
sa = str(input())
sb = str(input())
sc = str(input())
sa_count = 0
sb_count = 0
sc_count = 0
lst = [sa,sb,sc]
count = [sa_count,sb_count,sc_count]
k = 0
abc = 'abc'
flag = False

for _ in range(len(sa)+len(sb)+len(sc)):
    for i in range(3):
        if lst[k][count[k]]==abc[i]:
            count[k] += 1
            count[i] += 1
            k = i
            if count[k]==len(lst[k])+1:
                flag = True
                break
    if flag:
        break

print(abc[k].upper())

### FIXED CODE ###

sa = str(input())
sb = str(input())
sc = str(input())
sa_count = 0
sb_count = 0
sc_count = 0
tmp = 'a'

for _ in range(300):
    if tmp=='a':
        sa_count += 1
        if sa_count==len(sa)+1:
            print('A')
            break
        else:
            tmp = str(sa[sa_count-1])
    elif tmp=='b':
        sb_count += 1
        if sb_count==len(sb)+1:
            print('B')
            break
        else:
            tmp = str(sb[sb_count-1])
    elif tmp=='c':
        sc_count += 1
        if sc_count==len(sc)+1:
            print('C')
            break
        else:
            tmp = str(sc[sc_count-1])
F = input().split()
A = input().split()
s = 0
s += F[0] == A[0] ? 1 : 0
s += F[1] == A[1] ? 1 : 0
s += F[1] == A[2] ? 1 : 0
print(s)

### FIXED CODE ###

F = input()
A = input()
s = 0
s += 1 if F[0] == A[0] else 0
s += 1 if F[1] == A[1] else 0
s += 1 if F[2] == A[2] else 0
print(s)
a,b,c=map(int,imput().split())
if a+b+c >= 22:
   print("bust")
    else:
      print("win")

### FIXED CODE ###

a,b,c=map(int,input().split())
if a+b+c >= 22:
   print("bust")
else:
   print("win")
a, b = map(int, input())

if a >= b:
    print(a)

else:
    print(a - 1)
    

### FIXED CODE ###

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

if a <= b:
    print(a)

else:
    print(a - 1)
import numpy as np
n = int(input())
l = list(map(int, input().split()))
a = max(l)
b = l.remove(a)
c = np.sum(b)
if a < c:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

#import numpy as np
n = int(input())
l = list(map(int, input().split()))
a = max(l)
l.remove(a)

c = sum(l)
if a < c:
    print('Yes')
else:
    print('No')
n = int(input())
ans = 0
for i in range(1,n+1,2) :
 	cnt = 0
	for j in range(1,i+1) :
		if i % j == 0 :
        	cnt += 1
	if cnt == 8 :
		ans += 1
print(ans)     

### FIXED CODE ###

n = int(input())
cnt = 0
divisor = []
for i in range(1,n+1,2) :
        for j in range(1,i+1) :
                if i % j == 0 :
                        cnt += 1
        divisor.append(cnt)
        cnt = 0
ans = 0
for i in divisor :
        if i == 8 :
                ans += 1
print(ans)
#!/usr/bin/env python3
import sys
import bisect
import heapq

def solve(H: int, W: int, A: "List[str]"):
    Q = []
    marked = [[0] * W for h in range(H)]
    for h in range(H):
        for w in range(W):
            if A[h][w] == '#':
                heapq.heappush(Q, (0, h, w))
                marked[h][w] = 1
    dmax = 0
    while len(Q) > 0:
        d, h, w = heapq.heappop(Q)
        dmax = max(d, dmax)
        for hh, ww in [(h-1, w), (h+1, w), (h, w-1), (h, w+1)]:
            if 0 <= hh <= H-1 and 0 <= ww <= W-1 and marked[hh][ww] == 0:
                heapq.heappush(Q, (d+1, hh, ww))
                marked[hh][ww] = 1
    print(dmax)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    A = [ next(tokens) for _ in range(W) ]  # type: "List[str]"
    solve(H, W, A)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys

inf = float('inf')

def solve(H: int, W: int, A: "List[str]"):
    dist = [[inf] * W for h in range(H)]
    for h in range(1, H):
        for w in range(1, W):
            if A[h][w] == '#':
                dist[h][w] = 0
            else:
                dist[h][w] = min(dist[h-1][w], dist[h][w-1]) + 1
    
    dmax = 0
    for h in range(H-1, -1, -1):
        for w in range(W-1, -1, -1):
            if A[h][w] == '#':
                dist[h][w] = 0
            elif h+1 <= H-1 and w+1 <= W-1:
                dist[h][w] = min(dist[h][w], min(dist[h+1][w], dist[h][w+1]) + 1)
            elif w+1 == W and h+1 <= H-1:
                dist[h][w] = min(dist[h][w], dist[h+1][w] + 1)
            elif h+1 == H and w+1 <= W-1:
                dist[h][w] = min(dist[h][w], dist[h][w+1] + 1)
            dmax = max(dist[h][w], dmax)
    print(dmax) 
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    A = [ next(tokens) for _ in range(H) ]  # type: "List[str]"
    solve(H, W, A)

if __name__ == '__main__':
    main()
n,k = map(int,input().split())



for i in range(k):
    if i > -1:
        print(ans2)

    else:
        total = 1
        total2 = 1
        total3 = 1
        for j in range(i+1):
            total *= n-k+1-j
            total2 *= j+1
            total3 = int(total/total2)
            
        ww = (i+1)**(k-i-1)
        ans = ww * total3

        ans2 = ans % 1000000007

        print(ans2)
    


### FIXED CODE ###

n,k = map(int,input().split())
mod = 10**9+7

a = [1 for i in range(2010)]

memo = 1
for i in range(1,2001):
    memo *= i
    a[i] = memo



for i in range(1,k+1):
    if not((n-k+2 > i)):
        print(0)

    else:
        memo1 = a[n-k+1]*a[k-1]
        memo2 = a[i]*a[n-k+1-i]*a[i-1]*a[k-i]

        ans2 = memo1//memo2
        print(ans2%mod)
x=input()
if (x< 1200):
  	print("ABC")
elif (x<2800):
  	print("ARC")
else:
  	print("AGC")

### FIXED CODE ###

x = int(input())
print("ABC" if x < 1200 else ("ARC" if x < 2800 else "AGC"))
import math
N = int(input())
A = [int(j) for j in input().split()]
B = [0]*N
B = A[:]
gcdmx = 0
for j in range(0,N):
    gcdloc = 0
    C = B[:]
    del C[j]
    for k in range(0,N-1):
        gcdloc = math.gcd(gcdloc,C[k])
    gcdmx = max(gcdloc,gcdmx)
print(gcdmx)

### FIXED CODE ###

import fractions as f

n = int(input())
A = [int(_) for _ in input().split()]

left = []
right = []

left.append(A[0])
for i in range(1,n):
    left.append(f.gcd(left[i-1],A[i]))

right.append(A[n-1])
for i in range(1,n):
    right.append(f.gcd(right[i-1],A[n-1-i]))

ans = 0
for i in range(n):
    if i == 0:
        ans = right[n-2]
    if i >= 1 and i <= n-2:
        ans = max(ans,f.gcd(left[i-1],right[n-2-i]))
    if i == n-1:
        ans = max(ans,left[n-2])
print(ans)
N, M = map(int, input().split())
a = [0] * M
b = [0] * M

for i in range(M):
    a[i], b[i] = map(int, input().split())

index = []
for i in range(M):
    if b[i] == N:
        index  = i

for j in range(M):
    if b[j] == a[index]:
        if a[j] == 1:
            print("POSSIBLE")
            break
    else:
        print("IMPOSSIBLE")
        break


### FIXED CODE ###

N, M = map(int, input().split())
a = [0] * M
b = [0] * M

for i in range(M):
    a[i], b[i] = map(int, input().split())

s = []
t = []

for i in range(M):
    if a[i] == 1:
        s.append(b[i])
    elif b[i] == N:
        t.append(a[i])

if len(set(s) & set(t)) == 0:
    print("IMPOSSIBLE")
else:
    print("POSSIBLE")
from math import pi
print(pi*int(input())**2)


### FIXED CODE ###

from math import pi
k = float(input())
print(pi*k**2,pi*k*2)
n = input()
if n[-1] == ("2"or"4"or"5"or"7",or9") :
    print("hon")
elif n[-1] in("0"or"1"or"6"or"8"):
    print("pon")
else:
    print("bon")


### FIXED CODE ###

n = input()
if (n[-1] == "2")or(n[-1] == "4")or(n[-1] == "5")or(n[-1] == "7")or(n[-1] == "9") :
    print("hon")
elif (n[-1] == "0")or(n[-1] == "1")or(n[-1] == "6")or(n[-1] == "8"):
    print("pon")
else:
    print("bon")
n = int(input())
ans=0
ans = (n-1)*(n)//2
print(ians)

### FIXED CODE ###

n = int(input())
ans=0
ans = (n-1)*(n)//2
print(ans)
N,K=map(int,input().split())
L=list(map(int,input().split()))
E=[(V+1)//2 for v in L]
ans=sum(E[:K])
last=E[0]
for l in E[K:]:
  ans = max(ans,ans-last+l)
  last = l
print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
L = list(map(int, input().split()))
E = [(v+1)/2 for v in L]
tmp = sum(E[:K])
ans = tmp
for l, p in zip(E[K:], E):
    tmp = tmp+l-p
    ans = max(ans, tmp)
print(ans)
li = list()
li2 = list()
for _ in range(5):
    tmp = int(input())
    if(tmp % 10 == 0):
        li2.append(tmp)
    else:
        li.append(tmp)
li.sort(key=lambda x: x % 10, reverse=True)
li2.sort()
ans = sum(li2)
for i in range(len(li)-1):
    ans = ans + ((li[i] // 10 + 1) * 10)
ans += li[-1]
print(ans)


### FIXED CODE ###

li = list()
li2 = list()
for _ in range(5):
    tmp = int(input())
    if(tmp % 10 == 0):
        li2.append(tmp)
    else:
        li.append(tmp)
li.sort(key=lambda x: x % 10, reverse=True)
li2.sort()
ans = sum(li2)
if(len(li)!=0):
    for i in range(len(li)-1):
        ans = ans + ((li[i] // 10 + 1) * 10)
    ans += li[-1]
print(ans)
# coding: utf-8
# Your code here!
import math
n,K=map(int,input().split())
h=list(map(int,input().split()))
dp=[math.inf for _ in range(n)]
dp[0]=0
for i in range(1,n):
    for k in range(K):
        if i-k<0:
            continue
        else:
            dp[i]=min(dp[i],dp[i-k]+abs(h[i]-h[i-k]))
        print(dp)
print(dp)

### FIXED CODE ###

import math
n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[math.inf for i in range(n)]
dp[0]=0
for i in range(1,n):
    for j in range(1,k+1):
        if i-j<0:
            continue
        dp[i]=min(dp[i-j]+abs(h[i]-h[i-j]),dp[i])
print(dp[n-1])
N=int(input())
A=sorted(list(map(int,input().split())))
flag = False
for i in range(1,N):
  if A[i] == A[i-1]:
    flag = True
if frag:
  print("NO")
else:
  print("YES")

### FIXED CODE ###

N=int(input())
A=sorted(list(map(int,input().split())))
flag = False
for i in range(1,N):
  if A[i] == A[i-1]:
    flag = True
if flag:
  print("NO")
else:
  print("YES")
import typing


class DSU:
    '''
    Implement (union by size) + (path compression)
    Reference:
    Zvi Galil and Giuseppe F. Italiano,
    Data structures and algorithms for disjoint set union problems
    '''

    def __init__(self, n: int = 0):
        self._n = n
        self.parent_or_size = [-1] * n

    def merge(self, a: int, b: int) -> int:
        assert 0 <= a < self._n
        assert 0 <= b < self._n

        x = self.leader(a)
        y = self.leader(b)

        if x == y:
            return x

        if -self.parent_or_size[x] < -self.parent_or_size[y]:
            x, y = y, x

        self.parent_or_size[x] += self.parent_or_size[y]
        self.parent_or_size[y] = x

        return x

    def same(self, a: int, b: int) -> bool:
        assert 0 <= a < self._n
        assert 0 <= b < self._n

        return self.leader(a) == self.leader(b)

    def leader(self, a: int) -> int:
        assert 0 <= a < self._n

        if self.parent_or_size[a] < 0:
            return a

        self.parent_or_size[a] = self.leader(self.parent_or_size[a])
        return self.parent_or_size[a]

    def size(self, a: int) -> int:
        assert 0 <= a < self._n

        return -self.parent_or_size[self.leader(a)]

    def groups(self) -> typing.List[typing.List[int]]:
        leader_buf = [self.leader(i) for i in range(self._n)]

        result = [[] for _ in range(self._n)]
        for i in range(self._n):
            result[leader_buf[i]].append(i)

        return list(filter(lambda r: r, result))

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

uf = DSU(N)
merge = uf.merge
same = uf.same

for i in range(M):
    a,b = map(int, input().split())
    merge(a,b)


print(len(uf.groups())-1)

### FIXED CODE ###


class UnionFind:
    def __init__(self, N):
        self.root = list(range(N + 1))
        self.size = [1] * (N + 1)

    def __getitem__(self, x):
        root = self.root
        while root[x] != x:
            root[x] = root[root[x]]
            x = root[x]
        return x

    def merge(self, x, y):
        x = self[x]
        y = self[y]
        if x == y:
            return
        sx, sy = self.size[x], self.size[y]
        if sx < sy:
            x, y = y, x
            sx, sy = sy, sx
        self.root[y] = x
        self.size[x] += sy

    def same(self,x,y):
        return  self[x] == self[y]

    def find_max(self):
        return max(self.size)

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

uf = UnionFind(N)
merge = uf.merge
same = uf.same

for i in range(M):
    a,b = map(int, input().split())
    merge(a,b)
count = -1
for ind,j in enumerate(uf.root):
    if ind == j:
        count += 1

print(count -1)
N = int(input())
X = [int(i) for i in input().split(' ')]
count = 0
for i in range(N):
    if X[i]! = i+1:
        count+=1
if count <= 2:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

N = int(input())
X = [int(i) for i in input().split()]
count = 0
for i in range(N):
    if X[i] != i+1:
        count+=1
if count <= 2:
    print("YES")
else:
    print("NO")
import bisect
def seive():
  l[0]=0
  l[1]=0
  for i in range(2,10**5+1):
    if l[i]==1:
      k.append(i)
      for j in range(i*i,10**5+1,i):
        l[j]=0
l=[1]*(10**5+1)
k=[]
seive()
n=int(input())
d=bisect.bisect_left(k,n)
#print(d)
print(k[d])



### FIXED CODE ###

import bisect
def seive():
  l[0]=0
  l[1]=0
  for i in range(2,10**6+1):
    if l[i]==1:
      k.append(i)
      for j in range(i*i,10**6+1,i):
        l[j]=0
l=[1]*(10**6+1)
k=[]
seive()
#print(len(k))
n=int(input())
d=bisect.bisect_left(k,n)
print(k[d])
n = int(input())
l =[]
for i in range(n):
    l.append(int(input()))
l.sort()

for i in range(n-1):
    ave = (l[0] + l[1])/2
    l[0:2] = []
    l.insert(0,ave)
    
print(l[0])

### FIXED CODE ###

n = int(input())
l =list(map(int,input().split()))
l = sorted(l)
 
for i in range(n-1):
    ave = (l[0] + l[1])/2
    l[0:2] = []
    l.insert(0,ave)
    
print(l[0])
N, K = list(map(int, input().split())) 
A = list(map(int, input().split())) 

H0 = 1
H1 = 1

for i in range(N-K):
    for j in range(K):
        H0 = int(H0 * A[j])

    H1 = int(H0/A[i] * A[K+i])

    if H1 > H0:
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

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

H0 = 1
H1 = 1

for i in range(N-K):
    # for j in range(K):
    #     H0 = int(H0 * A[j])
    # H1 = int(H0/A[i] * A[K+i])
    H0 = A[i]
    H1 = A[K+i]

    if H1 > H0:
        print('Yes')
    else:
        print('No')
n,m = map(int,input().split())
a = [int(input()) for _ in range(m)]
mod = 10**9+7
memo = [-1]*(n+1)
def rec(x):
    if memo[x] != -1: pass
    elif x == 0: memo[x] = 1
    elif a and x == a[-1]:
        memo[x] = 0
        a.pop()
    elif x == 1: memo[x] = 1
    else: memo[x] = rec(x-1)+rec(x-2)
    return memo[x]%mod
print(rec(n))

### FIXED CODE ###

n,m = map(int,input().split())
aa = [int(input()) for i in range(m)]

cnt2 = 0
cnt1 = 1
aa.append(-1)
a = aa.pop(0)


for i in range(1,n):
    if i == a:
        cnt2, cnt1 = cnt1, 0
        a = aa.pop(0)
    else:
        cnt2, cnt1 = cnt1, cnt2+cnt1
else:
    ans = (cnt2+cnt1)%1000000007

print(ans)