Harryxun/stf_run huggingface dataset:
N = int(input())
A = list(map(int,input().split()))
dp = [[0]*3 for _ in range(N+1)]

dp[1][3] = A[0]
dp[2][2] = max(A[1],dp[1][3])

for i in range(2,N):
  a = A[i]
  mid = (i+1)//2
  ma = (i+2)//2
  mi = i//2
  dp[i+1][2+ma-mid] = max(dp[i][2+ma-i//2],dp[i-1][1+ma-(i-1)//2]+a)
  dp[i+1][2+mi-mid] = max(dp[i][2+mi-i//2],dp[i-1][1+mi-(i-1)//2]+a)

print(dp[-1][2])

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
dp = [{} for _ in range(N+1)]
INF = -float('inf')
for i in range(1,N+1):
    mid = i//2
    dp[i][mid-2],dp[i][mid-1],dp[i][mid],dp[i][mid+1],dp[i][mid+2]=INF,INF,INF,INF,INF
dp[1][1] = A[0]
dp[2][1] = max(A[1],dp[1][1])
dp[1][0],dp[2][0]=0,0

for i in range(2,N):
  a = A[i]
  ma = (i+2)//2
  mi = i//2
  dp[i+1][ma] = max(dp[i][ma],dp[i-1][ma-1]+a)
  dp[i+1][mi] = max(dp[i][mi],dp[i-1][mi-1]+a)

print(dp[-1][N//2])
import numpy as np
from itertools import product as p
N, K = map(int, input().split())
a = np.array(list(map(int, input().split())))
bs = np.array(list(p((True, False), repeat=N)))

z = np.zeros(N, dtype=int)
ids = np.arange(N)
if sum(a) < K:
 print(0)
else:
 for i in range(N):
  Si = sum(a[bs[i,:]])
  if Si < K: continue
  for j in ids[bs[i,:]]:
   if Si - a[j] < K: z[j] = 1
 print(N-sum(z))

### FIXED CODE ###

a, b = input().split()

if a == b:
 print('H')
else:
 print('D')
A, B, C = set(input().split())

print("Yes" len(A, B, C)==2 else "No")


### FIXED CODE ###


ABC = list(input().split())

print("Yes" if len(set(ABC))==2 else "No")
S = input()
n = len(S)
ans = 0
for bit in range(1 << (n-1)):
  f = S[0]
  for i in range(n-1):
    if bit & (1 << (n-1)):
      f += "+"
    f += S[i+1]
    ans += sum(map(int,f.split("+")
print(ans)             

### FIXED CODE ###

s = input()
n = len(s) - 1
answers = []
sl = [s[i] for i in range(len(s))]
for i in range(2 ** n):
    tmp = []
    for j in range(n):
        if ((i >> j) & 1):
            tmp.append(j)
    ll = ['*']*len(s)
    for k in tmp:
        ll[k] = '+'
    ans = []
    for k, _ in zip(sl, ll):
        ans.append(k)
        ans.append(_)
    ans = [_ for _ in ans if _ != '*']
    ans = ''.join(ans)
    ans = ans.split('+')
    ans = [int(_) for _ in ans if _ != '+']
    ans = sum(ans)
    answers.append(ans)
print(sum(answers))
n = input()

r = []
for i in range(n):
    r.append(input())

maxv =  int(-20000000)
minv = int(r[0])

for i in ranfe(n):
    maxv = max(maxv, r[i]-minv)
    minv = min(minv, r[i])

print(maxv)



### FIXED CODE ###

n = int(input())

maxv = -10**18
minv = 10**18

for i in range(n):
    r= int(input())
    maxv = max(maxv, r - minv)
    minv = min(minv, r)

print(maxv)
while True:
    a, b = raw_input().strip().split(" ")
    print len(str(int(a) + int(b)))

### FIXED CODE ###

#condig: UTF-8
 
while True:
    try:
        n = map(int, raw_input().split())
        s = len(str(n[0] + n[1]))
        print s
    except Exception:
        break
import numpy as np

N = int(raw_input())
W = map(int, raw_input().split())

total = sum(W)

ans = total

for i in range(N):
	total = total - W[i]
    if ans < np.abs(total):
      ans = int(np.abs(total))
      
print ans


### FIXED CODE ###

import numpy as np

N = int(raw_input())
W = map(int, raw_input().split())

total = sum(W)

ans = total

total_r = total
total_l = 0
for i in range(N):
        total_r = total_r - W[i]
        total_l = total_l + W[i]
        ans_temp = np.abs(total_r - total_l)
        if ans > ans_temp:
                ans = ans_temp

print ans
n, m, l = [int(i) for i in input().split()]

A = [input(range(n))]
B = [input(range(m))]
C = [[0] * 1 for n in range(n)]


for ni in range(n):
    A.append([int(i) for i in input().split()])

for mi in range(m):
    B.append([int(i) for i in input().split()])

C[n][m] = sum([A[n][l] * B[l][m]])

print(" ".join([str(v) for v in C]))

### FIXED CODE ###

n, m, l = [int(i) for i in input().split()]

A = []
B = []
C = []

for ni in range(n):
    A.append([int(i) for i in input().split()])

for mi in range(m):
    B.append([int(i) for i in input().split()])

for i in range(n):
    C.append([])
    for j in range(l):
        C[i].append(0)
        for k in range(m):
            C[i][j] += A[i][k] * B[k][j]

for li in range(n):
    print(" ".join([str(s) for s in C[li]]))
a=int(input())
b=int(input())

c=a*b
if c % 2 == 0:
    print("Even")
else:
    print("Odd")
    

### FIXED CODE ###

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

c=a*b
if c % 2 == 0:
  print("Even")
else:
  print("Odd")
from math import log2

N, K = map(int, input().split())
a = list(map(int, input().split()))
sa = sum(a)

b = [0 for _ in range(int(log2(sa)) + 1)]
# b[2進数の位] = そのbitが立っているAiの数

ls = int(log2(sa))
# print(ls)

for aa in a:
    for i in range(ls + 1):
        # print(aa, aa >> i, i)
        if (aa >> i) & 1 == 1:
            # print('if')
            b[i] += 1
# print(b)

x = []
if K > 0:
    for i in range(int(log2(K)) + 1):
        t = N - 2 * b[i]
        if t > 0:
            x.append((1 << i, t * (1 << i)))
            # (立てるフラグ値、答えの増加量)

    x = sorted(x, key=lambda xx: xx[1], reverse=True)
# print(x)

sx = 0
st = 0
for xx in x:
    if sx + xx[0] <= K:
        sx += xx[0]
        st += xx[1]

ans = sa + st
print(ans)

### FIXED CODE ###

from math import log2

N, K = map(int, input().split())
a = list(map(int, input().split()))
sa = sum(a)

if sa == 0:
    print(K * N)
    exit()

b = [0 for _ in range(int(log2(max(sa, K))) + 1)]
# b[2進数の位] = そのbitが立っているAiの数

ls = int(log2(sa))
# print(ls)

for aa in a:
    for i in range(ls + 1):
        # print(aa, aa >> i, i)
        if (aa >> i) & 1 == 1:
            # print('if')
            b[i] += 1
# print(b)

x = []
if K > 0:
    for i in range(int(log2(K)) + 1):
        t = N - 2 * b[i]
        if t > 0:
            x.append((1 << i, t * (1 << i)))
            # (立てるフラグ値、答えの増加量)

    x = sorted(x, key=lambda xx: xx[1], reverse=True)
# print(x)

sx = 0
st = 0
for xx in x:
    if sx + xx[0] <= K:
        sx += xx[0]
        st += xx[1]

ans = sa + st
print(ans)
m,n=input().split()
while n>0:
  m=m-int(input())
  n=n-1
if m>=0:
  print(m)
else:
  print(-1)

### FIXED CODE ###

m,n=map(int,input().split())
a=list(map(int,input().split()))
while n>0:
  m= m-a[n-1]
  n=n-1
if m>=0:
  print(m)
else:
  print(-1)
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
if a[0]-b[0]<0:
  totl=a[0]-b[0]
else:
  totl=0
for i in range(n):
  if b[i]+b[i+1]>a[i+1]:
    totl+=a[i+1]-b[i]-b[i+1]
    
print(sum(b)+totl)
  


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
cnt=0
for i in range(n):
  if b[i]-a[i]>0:
    cnt+=a[i]
    cnt+=min(b[i]-a[i],a[i+1])
    a[i+1]=max(a[i+1]-b[i]+a[i],0)
  else:
    cnt+=b[i]
print(cnt)
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
nn = [a, b, c, d, e]
for i in nn:
    if i == a:
        chk = i%10
        last = i
    else:
        if chk > i%10:
            chk = i%10
            last = i
s = False
for i in nn:
    if s == False and i == last:
        ans += i
        s = True
    else:
        ans += i + (10 - i%10)
print(ans)

### FIXED CODE ###

import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
nn = [a, b, c, d, e]
s = False
for i in nn:
    if s == False and i%10 != 0:
        chk = i%10
        last = i
        s = True
    elif s == False and i%10 == 0:
        pass
    elif s == True and i%10 != 0:
        if chk > i%10:
            chk = i%10
            last = i
if s == False:
    last = a
#print(last)
s = False
for i in nn:
    if s == False and i == last:
        ans += i
        s = True
    else:
        if i%10 == 0:
            ans += i
        else:
            ans += i + (10 - i%10)
    #print(ans)
print(ans)
def main():
	num = raw_input()
	val = raw_input()

	if int(num) < 10:
		rate = val + 100*(10-num)
	else:
  		rate = int(val)
	print rate
if __name__ == "__main__":
	main()

### FIXED CODE ###

def main():
	num,val = input().split(" ")
	num = int(num)
	val = int(val)

	if num < 10:
		print(val + 100*(10-num))
	else:
		print(val)

if __name__ == "__main__":
    main()
N=int(input())
t=[0]*N
r=set(range(N))
for _ in[0]*N:
 x,y,z=list(map(int,input().split()))
 t[x]=[y,z,0,0,(y!=-1)+(z!=-1),0,0]
 r-={y,z}
def f(i,p,s,d):
 if i<0:return-1
 t[i][2:]=[p,s,t[i][4],d,max(f(l,i,r,d+1),f(r,i,l,d+1))+1]
 return t[i][-1]
f(r.pop(),-1,-1,0)
for i in range(N):
 print('node {}: parent = {}, sibling = {}, degree = {}, depth = {}, height = {}, {}'.format(i,*t[i][2:],'root'if not t[i][5]else'internal node'if t[i][4]else'leaf'))


### FIXED CODE ###

N=int(input())
t=[0]*N
r=set(range(N))
for _ in[0]*N:
 x,y,z=map(int,input().split())
 t[x]=[y,z]+[0]*5
 r-={y,z}
def f(i,p,s,d):
 if i<0:return-1
 k=t[i]
 l,r=k[:2]
 k[2:]=[p,s,(l!=-1)+(r!=-1),d,max(f(l,i,r,d+1),f(r,i,l,d+1))+1]
 return t[i][-1]
f(r.pop(),-1,-1,0)
for i in range(N):
 print('node {}: parent = {}, sibling = {}, degree = {}, depth = {}, height = {}, {}'.format(i,*t[i][2:],'root'if not t[i][5]else'internal node'if t[i][4]else'leaf'))
def burst(S,k):
    S = "_" + S + "_"
    OP = []
    pt_l,pt_r = None,None
    for i in range(len(S)):
        if S[i] == k:
            if pt_l == None:
                pt_l = i-1
        elif pt_l != None:
            pt_r = i-2
            OP.append((pt_l,pt_r))
            pt_l,pt_r = None,None
    return OP

def merge(burst,k):
    if len(burst) <= k + 1:
        return burst[0][1] - burst[0][0] + 1
    else:
        output = 0
        for i in range(len(burst)-k):
            tmp = burst[k+i][1] - burst[i][0] + 1
            output = max(output,tmp)
        return output

N,K = map(int,input().split())
S = input()

burst1 = burst(S,"1")

if burst1[0][0] != 0:
    burst1 = [(0,0)] + burst1
if burst1[len(burst1)-1][1] != N-1:
    burst1 = burst1 + [(N-1,N-1)]

ans = merge(burst1,K)
print(ans)


### FIXED CODE ###

def burst(S):
    S += "_" #dummyを追加
    st,sp,ep = S[0],0,0
    S0,S1 = [],[]
    for i in range(1,len(S)):
        if st == S[i]:
            ep += 1
        else:
            if st == "0":
                S0.append((sp,ep))
            else:
                S1.append((sp,ep))
            st,sp,ep = S[i],i,i

    return [S0,S1]

def connect(S0,S1,K,len_S):
    if len(S0) == 0 or len(S1) == 0:
        return len_S
    else:
        if S1[0][0] != 0:
            S1 = [(0,0)] + S1
        if S1[len(S1)-1][1] != len_S-1:
            S1.append((len_S-1,len_S-1))
        if len(S1)-1 <= K:
            return len_S
        else:
            output = 0
            for i in range(len(S1)-K):
                output = max(output,S1[i+K][1]-S1[i][0]+1)
            return output

def main():
    N,K = map(int,input().split())
    S = input()

    T = burst(S)
    S0,S1 = T[0],T[1]
    print(connect(S0,S1,K,N))

if __name__ == "__main__":
    main()
n=int(input())
lst=[]
for i in range(n)
 lst.extend(str(input()))


list_uniq=[]
for j in lst
 if list_uniq.count(j)==0:
    list_uniq.extend(j)
 else:
    pass
 print(len(list_uniq))

 

### FIXED CODE ###

n=int(input())
lst={}
for i in range(n):
  lst[input()]=1
print(len(lst))
N = int(input())
prime_list = make_prime_list(N)
pcount={}
for p in prime_list:
    pcount[p]=0
for nn in range(2,num+1):
    for p in prime_list:
        n=nn
        if n<p:
            break
        while n%p==0:
            n//=p
            pcount[p]+=1
            
ans = 1
for i in pcount.values():
    ans *= (i + 1)
print(ans % (10 ** 9 + 7))

### FIXED CODE ###

N = int(input())
import math
def is_prime(num):
    if num < 2:
        return False
    if num == 2 or num == 3 or num == 5:
        return True
    if num % 2 == 0 or num % 3 == 0 or num % 5 == 0:
        return False

    # 疑似素数(2でも3でも5でも割り切れない数字)で次々に割っていく
    prime = 7
    step = 4
    num_sqrt = math.sqrt(num)
    while prime <= num_sqrt:
        if num % prime == 0:
            return False
        prime += step
        step = 6 - step

    return True
  
def make_prime_list(num):
    if num < 2:
        return []

    prime_list = []
    for prime in range(2, num + 1):
        if is_prime(prime):
            prime_list.append(prime)
    return prime_list
  
num = N
prime_list = make_prime_list(num)
pcount={}
for p in prime_list:
    pcount[p]=0
for nn in range(2,num+1):
    for p in prime_list:
        n=nn
        if n<p:
            break
        while n%p==0:
            n//=p
            pcount[p]+=1
            
ans = 1
for i in pcount.values():
    ans *= (i + 1)
print(ans % (10 ** 9 + 7))
A = int(input())
P = int(input())

N = (A*3+P%2)//2+P//2

print(N)


### FIXED CODE ###

A, P = (int(i) for i in input().split())
  
N = (A*3+P%2)//2+P//2

print(N)
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

k = int(input())

print(a[k])

### FIXED CODE ###

a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

k = int(input()) -1

print(a[k])
S = input()
S = input("")
if(S[2].__eq__(S[3]) and S[4].__eq__(S[5])):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

S = input("")
if(S[2].__eq__(S[3]) and S[4].__eq__(S[5])):
    print("Yes")
else:
    print("No")
import math

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

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append(i)

    if temp!=1:
        arr.append(temp)

    if arr==[]:
        arr.append(n)

    return arr
  
d = gcd(a,b)


### FIXED CODE ###

from fractions import gcd

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

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append(i)

    if temp!=1:
        arr.append(temp)

    return arr
  
d = gcd(a,b)
print(len(factorization(d)) + 1)
n,k=list(map(int,input().split()))
h=[range(1,n+1)]
a=[]
for i in range(k):
    d=int(input())
    b=list(map(int,input().split()))
    a.append(*b)
c=set(a)
ans=n-len(c)
print(ans)

### FIXED CODE ###

N,K=list(map(int,input().split()))
h=[]
for k in range(K):
    d_i=int(input())
    a=list(map(int,input().split()))
    for i in range(d_i):
        h.append(a[i])
h2=set(h)
ans=N-len(h2)
print(ans)
a,b,c=map(int,input(),split())
if a<=c and c<=b:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

a,b,c=map(int,input().split())
if a<=c and c<=b:
    print("Yes")
else:
    print("No")
n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]
b = [0, 1]
c = []
ans = 1

for _ in range(n):
    b.append(b[-1] + b[-2])

c.append(a[0])
for i in range(m - 1):
    c.append(a[i + 1] - a[i] - 1)
c.append(n - a[m - 1])

for i in c:
    ans *= b[i]

print(ans % 1000000007)


### FIXED CODE ###

n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]
b = [0, 1]
c = []
ans = 1

for _ in range(n):
    b.append(b[-1] + b[-2])

if m == 0:
    ans = b[n + 1]
else:
    c.append(a[0])
    for i in range(m - 1):
        c.append(a[i + 1] - a[i] - 1)
    c.append(n - a[m - 1])

    for i in c:
        ans *= b[i]

print(ans % 1000000007)
n,T = map(int,input().split())
c = list(input().split())
t = list(input().split())
min = 1000
for i in range(n):
    if int(T) > int(t[i]) and min > int(c[i]):
        min = int(c[i])
if min ==1000:
    print('TLE')
else:
    print(min)

### FIXED CODE ###

n,T= map(int,input().split())
min = 1001
for i in range(n):
    c,t = map(int,input().split())
    if T >= t and min > c:
        min = c
if min > 1000:
    print('TLE')
else:
    print(min)
n,w=map(int,input().split())
weight=[]
value=[]
total=w
for i in range(n):
    x,y=map(int,input().split())
    weight.append(x)
    value.append(y)
l=len(weight)
dp=[[0]*w for j in range(l)]
for i in range(l):
    for w in range(total+1):
        if weight[i]<=w:
            dp[i][w]=max(value[i]+dp[i-1][w-weight[i]],dp[i-1][w])
        else:
            dp[i][w] = dp[i-1][w]
print(dp[l-1][total])

### FIXED CODE ###

import numba as nb
import sys
import numpy as np
@nb.njit
def solve(w,weight,value):
    total=w
    dp = np.zeros(shape=(n + 1, w + 1), dtype=np.int64)
    for i in range(l):
        for w in range(total+1):
            if weight[i]<=w:
                dp[i][w]=max(value[i]+dp[i-1][w-weight[i]],dp[i-1][w])
            else:
                dp[i][w] = dp[i-1][w]
    print(dp[l-1][total])
n,w=map(int,sys.stdin.readline().split())
weight=[0]*n
value=[0]*n
total=w
for i in range(n):
    x,y=map(int,sys.stdin.readline().split())
    weight[i]=x
    value[i]=y
l=len(weight)
solve(w,weight,value)
import sys
sys.setrecursionlimit(5000)
n = int(input())
X = input()
nx = int(X, 2)
def f(n):
    pc = bin(n).count('1')
    nn = n%pc
    if nn == 0:
        return 1
    return f(nn) + 1

for i in range(n-1, -1, -1):
    # ibit目を反転させる # つまりi**2を引く
    tmp = pow(2, i)

    if (nx>>i)&1:
        nx -= tmp
        print(f(nx))
        nx += tmp
    else:
        nx += tmp
        print(f(nx))
        nx -= tmp


### FIXED CODE ###

n = int(input())
X = input()
pc = X.count('1')
nx = int(X, 2)

def f(n):
    c = 0
    while n > 0:
        n %= bin(n).count('1')
        c += 1
    return c

nxp = nx%(pc+1)
nxm = nx%(pc-1) if pc > 1 else 0
for i in range(n-1, -1, -1):
    if (nx>>i)&1:
        # 2**iを引く
        if pc-1 == 0:
            print(0)
            continue
        p = pow(2, i, pc-1)
        r = (nxm-p)%(pc-1)
    else:
        # 2**iを足す
        r = (nxp+pow(2, i, pc+1))%(pc+1)

    print(f(r) + 1)
s = input()
n = len(s)

ans = [1]*n
for i,a = in enumerate(s):
    if a =="R":
        a2 = s[i+1]
        if a2 =="R":
            ans[i+2] += ans[i]
            ans[i] = 0

for i in range(n-1,-1,-1):
    a = s[i]
    if a =="L":
        a2 = a[i-1]
        if a2 =="L":
            ans[i-2] += ans[i]
            ans[i] = 0
print(*ans)

### FIXED CODE ###

s = input()
n = len(s)

ans = [1]*n
for i,a in enumerate(s):
    if a =="R":
        a2 = s[i+1]
        if a2 =="R":
            ans[i+2] += ans[i]
            ans[i] = 0

for i in range(n-1,-1,-1):
    a = s[i]
    if a =="L":
        a2 = s[i-1]
        if a2 =="L":
            ans[i-2] += ans[i]
            ans[i] = 0
print(*ans)
H, W = map(input().split())
a = [input() for i in range(H)]
block = '#' * (W+2)
print(block)
for s in a:
    print('#' + s + '#')
print('#' * (W+2))

### FIXED CODE ###

H, W = map(int, input().split())
a = [input() for i in range(H)]
block = '#' * (W+2)
print(block)
for s in a:
    print('#' + s + '#')
print('#' * (W+2))
import math
A, B, N = map(int, input().split())
ans = []
for x in range(B, N+1):
    cal = math.floor((A*x)/B) - (int(A) * math.floor(x/B))
    ans.append(cal)
print(max(ans))

### FIXED CODE ###

a, b, n = map(int, input().split())
n = min(n, b-1)
 
print(int((a * n) / b) - a * int(n / b))
a = list(map(int,input().split())).sort()
k = int(input())
print(a[0]+a[1]+a[2]*(2**k))

### FIXED CODE ###

a = list(map(int,input().split()))
a.sort()
k = int(input())
print(a[0]+a[1]+a[2]*(2**k))
a, b = map(int, input().split())

if a == 1:
    a = 14
if b == 1:
    b = 14

print('Draw' if a=b elif 'Alice' a>b else 'Bob') 

### FIXED CODE ###

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

if a == 1:
    a = 14
if b == 1:
    b = 14


print('Draw' if a==b else 'Alice' if a>b else 'Bob')
S = input()

c = 0
max = 0

for i in S:
  if i==R:
    c += 1
  else:
    max = max([c, max])
    c = 1
    
print(max)

### FIXED CODE ###

S = input()
a = 0
for i in range(3):
  if S[i]=="R":
    a+=1
  if S[i]=="S" and a>0:
      break
print(a)
import re
import math

def fib(n):
    if n == 1:
        return 0
    elif n == 2:
        return 1
    else:
        return fib(n-1)+fib(n-2)

n,m = map(int, input().split())
step = ['0']*(n+1)
for i in range(m):
    a = int(input())
    step[a] = '1'
steps = ''.join(step)

a = re.findall('0+', steps)
b = len(re.findall('11', steps))
# print(steps)
count = 1
for i in a:
    count *= fib(len(i)+1)

if b != 0:
    print(0)
else:
    print(round(count % 1000000007))


### FIXED CODE ###

import re
import math

def fib(n):
    a, b = 0, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b

n,m = map(int, input().split())
step = ['0']*(n+1)
for i in range(m):
    a = int(input())
    step[a] = '1'
steps = ''.join(step)

a = re.findall('000*', steps)
b = len(re.findall('11', steps))
# print(steps)
count = 1
for i in a:
    count *= fib(len(i)+1) % 1000000007

if b != 0:
    print(0)
else:
    print(count % 1000000007)
n,a=map(int,input().split())
x=list(map(lambda x:int(x)-a,input().split()))
m=min(x)*n;M=max(x)*n+1
if max(x)<0 or min(x)>0:print(0);exit()
dp=[[0]*(M-m) for _ in range(n)]
dp[0][x[0]]+=1
dp[0][0]+=1
for i in range(n-1):
    for j in range(m,M):
        dp[i+1][j+x[i+1]]+=dp[i][j]
        dp[i+1][j]+=dp[i][j]
print(dp[n-1][0]-1)

### FIXED CODE ###

n,a=map(int,input().split())
x=list(map(lambda x:int(x)-a,input().split()))
m=0 if min(x)>0 else min(x)*n
M=1 if max(x)<0 else max(x)*n+1
dp=[[0]*(M-m) for _ in range(n)]
dp[0][x[0]]+=1
dp[0][0]+=1
for i in range(n-1):
    for j in range(m,M):
        if j+x[i+1] in range(m,M):dp[i+1][j+x[i+1]]+=dp[i][j]
        dp[i+1][j]+=dp[i][j]
print(dp[n-1][0]-1)
N,M = map(int, input().split())
p = [0]*M
S = [0]*M
for i in range(M):
    p[i],S[i] = input().split()
import numpy as np
p = [int(s) for s in p]
p1 = np.array(p)
S1 = [1 if i=="AC" else 0 for i in S]
N1 = list(set(p1 * S1))


if p ==[]:
    print("0 0")
else:
    A = 0
    B = 0
    for i in range(M):
        if p1[i] in N1:
            A += S1[i]
            B += (a-S1[i])
            if S1[i] ==1:
                N1.remove(p1[i])
    print(str(A)+" "+str(B))

### FIXED CODE ###

N,M = map(int, input().split())
p = [0]*M
S = [0]*M
for i in range(M):
    p[i],S[i] = input().split()
q = [int(s)-1 for s in p]
X = [0]*N
Y = [0]*N
A = 0
B = 0
for i in range(M):
    if S[i] == "AC":
        if Y[q[i]]==0:
            Y[q[i]]+=1
            A += 1
            B += X[q[i]]
    else:
        if Y[q[i]]==0:
            X[q[i]] += 1
print(str(A)+" "+str(B))
S = list(map(str, input()))
for i in range(len(S)):
  if i % 2 == 0:
    if S[i] == "L":
      print("No")
  else:
    if S[i] == "R":
      print("No")
print("Yes)


### FIXED CODE ###

S = list(map(str, input()))
unreadble = 0
for i in range(len(S)):
  if i % 2 == 0:
    if S[i] == "L":
      unreadble += 1
  else:
    if S[i] == "R":
  	  unreadble += 1
if unreadble >= 1:
  print("No")
else:
  print("Yes")
while True:
    x,y = map(int,input().split())
    if x > y:
        print(f'{y}{x})
    elif x < y:
        print(f'{x}{y})
    if x == 0 or y == 0:
        break


### FIXED CODE ###

while True:
    x,y = map(int,input().split())
    if x == 0 and y == 0:
        break
    if x > y:
        print(f"{y} {x}")
    elif x <= y:
        print(f"{x} {y}")