CodeEff/ECCO huggingface dataset:
# Original solution
import math

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

ans = 1
a_pre = -1
for mi in range(m):
    a = int(eval(input()))
    if a == a_pre:
        break
    elif a == a_pre + 1:
        ans = 0
        break
    k = a - a_pre - 2
    max_2 = k//2
    cnt = 0
    for i in range(max_2+1):
        cnt += math.factorial(k-i) // (math.factorial(k-2*i) * math.factorial(i)) % 1000000007
    ans = ans * cnt % 1000000007
    if ans == 0:
        break
    a_pre = a

a = n + 1
if a == a_pre:
    pass
elif a == a_pre + 1:
    ans = 0
else:
    k = a - a_pre - 2
    max_2 = k//2
    cnt = 0
    for i in range(max_2+1):
        cnt += math.factorial(k-i) // (math.factorial(k-2*i) * math.factorial(i)) % 1000000007
    ans = ans * cnt % 1000000007

print(ans)


# Optimized solution
n, m = [int(i) for i in input().split()]

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

for mi in range(m):
    b[int(eval(input()))] = 1
cnt = 0
s = [0 for i in range(n+1)]
s[0] = 1
if b[1] == 0:
    s[1] = 1
else:
    s[1] = 0
for ni in range(2,n+1):
    if b[ni] == 0:
        s[ni] = (s[ni-1] + s[ni-2]) % 1000000007
    else:
        s[ni] = 0
print((s[n]))
# Original solution
n,m = list(map(int,input().split()))
A = [int(eval(input())) for _ in range(m)]
mod = 1000000007
dp = [0]*(n+1)
dp[0] = 1
for i in range(1,n+1):
    dp[i] = (dp[i-1] + dp[i-2])%mod
    if i in A:dp[i] = 0
print((dp[n]))


# Optimized solution
n,m = list(map(int,input().split()))
A = set([int(eval(input())) for _ in range(m)])
mod = 1000000007
dp = [0]*(n+1)
dp[0] = 1
for i in range(1,n+1):
    dp[i] = (dp[i-1] + dp[i-2])%mod
    if i in A:dp[i] = 0
print((dp[n]))
# Original solution
n,m = list(map(int,input().split()))
base = [int(eval(input())) for i in range(m)]
count = 0
now = 0
i= 0

dp = [0]*(n+1)
if 1 in base:
  dp[1] = 0
else:
  dp[1] = 1

dp[0] = 1

for i in range(2,n+1):
  if not(i in base):
    dp[i] = dp[i-1] + dp[i-2]
  
  
print((int(dp[n]%1000000007)))

# Optimized solution
n,m = list(map(int,input().split()))
base = [int(eval(input())) for i in range(m)]
i= 0
j = 0

dp = [0]*(n+1)
if m == 0:
  base = [n+1]

if 1 == base[j]:
  dp[1] = 0
  if j < m-1:
    j = j + 1
else:
  dp[1] = 1

dp[0] = 1

for i in range(2,n+1):
  if not (i == base[j]):
    dp[i] = dp[i-1] + dp[i-2]
  elif i == base[j]:
    if j < m-1:
      j = j + 1
  
  
print((int(dp[n]%1000000007)))
# Original solution
n,m = list(map(int,input().split()))
a = []
a.append(0)
for i in range(m):
    b = int(eval(input()))
    b -= 1
    a.append(b)
a.append(n)
b = []
b.append(1)
b.append(2)

for i in range(n-2):
    c =b[i]
    d = b[i+1]
    e = c + d
    b.append(e)

c = []
if a[1] == 0:
    c.append(1)
else:
    c.append(b[a[1] - a[0]  - 1])
i = 1
while i <= m:
    if a[i + 1] - a[i] - 3 >= 0:
        c.append(b[a[i + 1] - a[i]  - 3])
        i += 1
    elif a[i + 1] - a[i] - 2 == 0:
        c.append(1)
    else:
        c.append(0)
        break
#print(c)
d = c[0] 
i = 1
#print(d)
while i < len(c):
    d = d * c[i]
    i += 1
e = 1000000007
print((d % e))
#print(b[0])



# Optimized solution
n,m = list(map(int,input().split()))
mod = 10**9 + 7
a = [1] * (n+1)
for i in range(m):
    b = int(eval(input()))
    a[b] = 0

        
for i in range(2,n+1):
    if a[i] != 0:
        a[i] = a[i-1] + a[i-2]
#print(a)
print((a[n] % mod))
# Original solution
N, M = list(map(int, input().split()))

dp = [1, 2]
A = [int(eval(input())) for _ in range(M)]
if M != 0:
    if M >= 2 and A[0] == 1 and A[1] == 2:
        dp = [0, 0]
    elif A[0] == 1:
        dp = [0, 1]
    elif A[0] == 2:
        dp = [1, 0]
else:
    A = [0]

MOD = 1000000007

if N == 1:
    while True:
        pass
    print((0))
if N == 2:
    print((dp[-1]))
else:
    cnt = 0
    for n in range(2, N):
        while(cnt < M - 1 and A[cnt] < n + 1):
            cnt += 1
        if A[cnt] == n + 1:
            dp[0] = dp[1]
            dp[1] = 0
        else:
            new_val = (max(dp[0], 0) + max(dp[1], 0)) % MOD
            dp[0] = dp[1]
            dp[1] = new_val

    print((dp[-1]))


# Optimized solution
N, M = list(map(int, input().split()))

dp = [1, 2]
A = [int(eval(input())) for _ in range(M)]
if M != 0:
    if M >= 2 and A[0] == 1 and A[1] == 2:
        dp = [0, 0]
    elif A[0] == 1:
        dp = [0, 1]
    elif A[0] == 2:
        dp = [1, 0]
else:
    A = [0]

MOD = 1000000007

if N == 1:
    print((1))
elif N == 2:
    print((dp[-1]))
else:
    cnt = 0
    for n in range(2, N):
        while(cnt < M - 1 and A[cnt] < n + 1):
            cnt += 1
        if A[cnt] == n + 1:
            dp[0] = dp[1]
            dp[1] = 0
        else:
            new_val = (max(dp[0], 0) + max(dp[1], 0)) % MOD
            dp[0] = dp[1]
            dp[1] = new_val

    print((dp[-1]))
# Original solution
import sys


n, m = [int(_) for _ in input().split()]
l = []
for i in range(m):
    l.append(int(eval(input())))

d = [0] * (n + 2)
d[0] = 1
if 1 not in l:
    d[1] = 1
for i in range(n):
    if i in l and i + 1 in l:
        print((0))
        sys.exit()
    elif i in l:
        d[i + 2] = d[i + 1]
    elif i + 1 in l:
        d[i + 2] = d[i]
    else:
        d[i + 2] = d[i] + d[i + 1]
    d[i + 2] = d[i + 2] % (10 ** 9 + 7)
print((d[-2]))

# Optimized solution
import sys


n, m = [int(_) for _ in input().split()]
l = {}
for i in range(m):
    l[int(eval(input()))] = 1

d = [0] * (n + 2)
d[0] = 1
if 1 not in l:
    d[1] = 1
for i in range(n):
    if i in l and i + 1 in l:
        print((0))
        sys.exit()
    elif i in l:
        d[i + 2] = d[i + 1]
    elif i + 1 in l:
        d[i + 2] = d[i]
    else:
        d[i + 2] = d[i] + d[i + 1]
    d[i + 2] = d[i + 2] % (10 ** 9 + 7)
print((d[-2]))
# Original solution
import sys
N,M = list(map(int, input().strip().split(' ')))
broken = set(int(line.strip()) for line in sys.stdin)
p = [0]*(N+2)
p[0] = 1
for i in range(N):
  # 今i段目にいる
  if i in broken:
    continue
  p[i+1] += p[i]
  p[i+2] += p[i]
print((p[N]%1000000007))


# Optimized solution
import sys
N,M = list(map(int, input().strip().split(' ')))
if M > 0:
  broken = set(int(line.strip()) for line in sys.stdin)
else:
  broken = set()
p = [0]*(N+2)
p[0] = 1
for i in range(N):
  # 今i段目にいる
  if i in broken:
    continue
  p[i+1] += p[i]
  p[i+2] += p[i]
print((p[N]%1000000007))
# Original solution
from operator import mul
from functools import reduce

mod = 10 ** 9 + 7
def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, list(range(n, n - r, -1)), 1)
    denom = reduce(mul, list(range(1, r + 1)), 1)
    return numer // denom

def pat(n):
  cnt = 0
  for i in range(n//2 + 1):
    cnt += int(combinations_count(n - i, i))
  return cnt

n, m = list(map(int, input().split()))
a = []
start = 0
cnt = 1
for i in range(m):
  ko = int(eval(input()))
  end = ko - 1
  cnt = cnt * pat(end - start)
  start = ko + 1
cnt = cnt * pat(n - start)

print((cnt % mod))
  

# Optimized solution
n, m = list(map(int, input().split()))
MOD = 1000000007

fact=[0,1]
fact_inv=[0]*(n+1)
for i in range(2,n+1):
  fact.append(fact[-1]*i % MOD)

fact_inv[n] = pow(fact[n],MOD-2,MOD)
for i in range(n-1,-1,-1):
  fact_inv[i] = fact_inv[i+1]*(i+1)%MOD

def comb(n,r):
  return fact[n]*fact_inv[r]*fact_inv[n-r]%MOD

def sigmaComb(dis):
  ans=0
  if dis == 1 or dis == 0:
    return 1
  end=dis//2+1
  for i in range(end):
    t=comb(dis-i,i)
    #print(dis-i,i,t)
    ans+=t
  return ans

hole=[0]
ans=1
for i in range(m):
  t = int(eval(input()))
  availLeft=hole[-1]
  availRight=t-1
  dis=availRight-availLeft
  if dis <0:
    ans=0
    break

  ans=ans*sigmaComb(dis)%MOD
  #print("dis=",dis,t,ans)
  hole.append(t+1)
else:
  availLeft=hole[-1]
  availRight=n
  dis=availRight-availLeft
  #print("dis=",dis,hole[-1],ans)
  ans=ans*sigmaComb(dis)%MOD

print((ans%MOD))
# Original solution
n, m = list(map(int,input().split()))
a = [int(eval(input())) for i in range(m)]

dp = [0] * (n+1)
dp[0] = 1

for i in range( 1, n+1):
    if i in a:
        dp[i]= 0
    else:
        dp[i]= (dp[i-1] + dp[i-2])

print((dp[n] % 1000000007))

# Optimized solution
n, m = list(map(int,input().split()))
a = [int(eval(input())) for i in range(m)]
a = set(a)
dp = [0] * (n+1)
dp[0] = 1

for i in range( 1, n+1):
    if i in a:
        dp[i]= 0
    else:
        dp[i]= (dp[i-1] + dp[i-2])

print((dp[n] % 1000000007))
# Original solution
import math
from fractions import Fraction
import sys

from fractions import Fraction
import sys
sys.setrecursionlimit(15000)

def fibMul(fn1, fn2):
    a = fn1[0]
    b = fn1[1]
    c = fn2[0]
    d = fn2[1]
    return (a*c + 5*b*d, a*d + b*c)

def fibExp(fn, n):
    if (n == 0):
        return (Fraction(1), Fraction(1));
    if (n % 2 == 0):
        return fibExp(fibMul(fn, fn), n / 2);
    return fibMul(fn, fibExp(fn, n - 1));

def fibMin(fn1, fn2):
    a = fn1[0]
    b = fn1[1]
    c = fn2[0]
    d = fn2[1]
    return (a - c, b - d)

def fibMain(n):
    fibNum1 = (Fraction(1, 2), Fraction( 1, 2))
    fibNum2 = (Fraction(1, 2), Fraction(-1, 2))
    fibNum3 = fibMin(fibExp(fibNum1, n), fibExp(fibNum2, n)) 
    fibNum4 = (Fraction(0, 1), Fraction(1, 5))
    return fibMul(fibNum3, fibNum4)

def fib(n):
    return fibMain(n)[0].numerator



n, m =list(map(int, input().split()))  #複数数値入力
a = [-1]
for i in range(m):
    ai = int(eval(input()))
    a.append(ai)
a.append(n+1)

count = 1
root5 = math.sqrt(5)
for i in range(m+1):
    x = a[i+1] - a[i] -1
    if x == 0:
        count = 0
        break
    else:
#         y = 1/root5 *(((1+root5)/2)**x - ((1-root5)/2)**x) 
        count *= fib(x)
print((int(count)%1000000007))

# Optimized solution
import math
from fractions import Fraction
import sys


class multipliable_2x2matrix(object):
    def __init__(self, a, b, c, d):
        self.a = a;
        self.b = b;
        self.c = c;
        self.d = d;
    def mul(self, b):
        return multipliable_2x2matrix(
            self.a * b.a + self.b * b.c,
            self.a * b.b + self.b * b.d,
            self.c * b.a + self.d * b.c,
            self.c * b.b + self.d * b.d)
    
def fib(n):
    if n == 0: return 0
    m = multipliable_2x2matrix(1, 1, 1, 0)
    f = multipliable_2x2matrix(1, 0, 0, 1)
    n = n - 1
    while n > 0:
        if n & 1 == 1:
            f = f.mul(m)
        n = n >> 1
        m = m.mul(m)
    return f.a



n, m =list(map(int, input().split()))  #複数数値入力
a = [-1]
for i in range(m):
    ai = int(eval(input()))
    a.append(ai)
a.append(n+1)

count = 1
root5 = math.sqrt(5)
for i in range(m+1):
    x = a[i+1] - a[i] -1
    if x == 0:
        count = 0
        break
    else:
#         y = 1/root5 *(((1+root5)/2)**x - ((1-root5)/2)**x) 
        count *= fib(x)
print((int(count)%1000000007))
# Original solution
N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
MOD = int(1e9) + 7

stair = []
for i in range(N):
    if i+1 in a:
        stair.append(False)
    else:
        stair.append(True)

# DP
dp = [0] * N
if stair[0]:
    dp[0] = 1
if N >= 2:
    if stair[1]:
        dp[1] = dp[0] + 1
    else:
        dp[1] = 0

for i in range(2, N):
    if not stair[i]:
        dp[i] = 0
        continue
    if stair[i-1] and stair[i-2]:
        dp[i] = (dp[i-1] + dp[i-2])%MOD
    elif stair[i-1]:
        dp[i] = dp[i-1]
    elif stair[i-2]:
        dp[i] = dp[i-2]

print((dp[N-1]))



# Optimized solution
N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
MOD = int(1e9) + 7

stair = [True] * N
for i in a:
    stair[i-1] = False

# DP
dp = [0] * N
if stair[0]:
    dp[0] = 1
if N >= 2:
    if stair[1]:
        dp[1] = dp[0] + 1
    else:
        dp[1] = 0

for i in range(2, N):
    if not stair[i]:
        dp[i] = 0
        continue
    if stair[i-1] and stair[i-2]:
        dp[i] = (dp[i-1] + dp[i-2])%MOD
    elif stair[i-1]:
        dp[i] = dp[i-1]
    elif stair[i-2]:
        dp[i] = dp[i-2]

print((dp[N-1]))
# Original solution
N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
dp = [0 for _ in range(N+1)]
MOD = int(1e9) + 7
dp[0] = 1
# DP
if 1 not in a:
    dp[1] = 1
for i in range(2, N+1):
    if i in a:
        continue
    dp[i] = (dp[i-2] + dp[i-1]) % MOD
print((dp[-1]))

# Optimized solution
N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
MOD = int(1e9) + 7

stair = [True] * N
for i in a:
    stair[i-1] = False

# DP
dp = [0] * N
if stair[0]:
    dp[0] = 1
if N >= 2:
    if stair[1]:
        dp[1] = dp[0] + 1
    else:
        dp[1] = 0

for i in range(2, N):
    if not stair[i]:
        dp[i] = 0
        continue
    if stair[i-1] and stair[i-2]:
        dp[i] = (dp[i-1] + dp[i-2])%MOD
    elif stair[i-1]:
        dp[i] = dp[i-1]
    elif stair[i-2]:
        dp[i] = dp[i-2]

print((dp[N-1]))
# Original solution
N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
MOD = int(1e9) + 7

stair = [True] * N
for i in a:
    stair[i-1] = False

# DP
dp = [0] * N
if stair[0]:
    dp[0] = 1
if N >= 2:
    if stair[1]:
        dp[1] = dp[0] + 1
    else:
        dp[1] = 0

for i in range(2, N):
    if not stair[i]:
        dp[i] = 0
        continue
    if stair[i-1] and stair[i-2]:
        dp[i] = (dp[i-1] + dp[i-2])%MOD
    elif stair[i-1]:
        dp[i] = dp[i-1]
    elif stair[i-2]:
        dp[i] = dp[i-2]

print((dp[N-1]))

# Optimized solution
N, M = list(map(int, input().split()))
st = [1 for _ in range(N+1)]
for _ in range(M):
    st[int(eval(input()))] = 0
dp = [0 for _ in range(N+1)]
MOD = int(1e9) + 7
dp[0] = 1
# DP
if st[1]:
    dp[1] = 1
for i in range(2, N+1):
    if st[i]:
        dp[i] = (dp[i-1] + dp[i-2]) % MOD
print((dp[-1]))
# Original solution
N, M = list(map(int, input().split()))
A = []
for m in range(M):
    A.append(int(eval(input())))
    
dp = [0]*(N+2)

dp[N] = 1
dp[N+1] = 0

for i in range(N-1, -1, -1):
    if i in A:
        dp[i] = 0
    else:
        dp[i] = (dp[i+1] + dp[i+2]) % 1000000007
    
print((dp[0]))

# Optimized solution
N, M = list(map(int, input().split()))
A = []
for m in range(M):
    A.append(int(eval(input())))


broken = [0]*(N+2)
for a in A:
    broken[a] = 1

dp = [0]*(N+2)

dp[N] = 1
dp[N+1] = 0

for i in range(N-1, -1, -1):
    if broken[i]:
        dp[i] = 0
    else:
        dp[i] = (dp[i+1] + dp[i+2]) % 1000000007
    
print((dp[0]))
# Original solution
n, m = list(map(int, input().split()))
bad = [int(eval(input())) for _ in range(m)]
back2 = 0
back1 = 1
MOD = int(1e9+7)

for i in range(n):
    if i + 1 in bad:
        back2, back1 = back1%MOD, 0
    else:
        back2, back1 = back1%MOD, (back2+back1)%MOD

print(back1)

# Optimized solution
import sys
sys.setrecursionlimit(150000)

n, m = list(map(int, input().split()))
bad = [int(eval(input())) for _ in range(m)]
MOD = int(1e9+7)

memo = {0:1, 1:1}
for i in bad:
    memo[i] = 0

def fib(n, mod):
    if n not in memo:
        memo[n] = (fib(n-1, mod) + fib(n-2, mod)) % mod
    return memo[n]

print((fib(n, MOD)))
# Original solution
N, M = list(map(int, input().split()))
MOD = 10**9+7
broken = [int(eval(input())) for _ in range(M)]
l = [0]*(N+1)

for i in range(N+1):
    if i in broken:
        continue
    elif i==0 or i==1:
        l[i] = 1
    else:
        l[i] = l[i-1] + l[i-2]
    l[i] %= MOD

print((l[N]))

# Optimized solution
N, M = list(map(int, input().split()))
MOD = 10**9+7
broken = [int(eval(input())) for _ in range(M)]
l = ["empty"]*(N+1)
l[0], l[1] = 1, 1
for i in broken:
    l[i] = 0

for i in range(N+1):
    if l[i] == "empty":
        l[i] = (l[i-1] + l[i-2]) % MOD

print((l[N]))
# Original solution
#A問題
N,M = list(map(int,input().split()))
A = []
mod = 1000000007
for i in range(M):
    A.append(int(eval(input())))

sta = []
for i in range(N+1):
    if i == 0:
        sta.append(1)
    elif i == 1:
        sta.append(1)
    elif i == 2:
        sta.append(2)
    else:
        sta.append(sta[i-1]+sta[i-2])

row = []
now = 1
flag = 0
for i in range(N):
    I = i+1
    if i == 0:
        if I in A:
            now = 0
            flag = 1
        else:
            now+=1
    else:
        if I in A:
            if flag == 1:
                flag = 2
                break
            else:
                row.append(now)
                now = 0
                flag = 1
        else:
            flag = 0
            now+=1

if flag == 2:
    print((0))
else:
    row.append(now)
    ans = 1
    for r in row:
        ans = (ans*sta[r-1])%mod
    print(ans)

# Optimized solution
#C問題
mod = 10**9+7
N,M = list(map(int,input().split()))

step = []
for i in range(N+2):
    if i <= 1:
        step.append(1)
    elif i == 2:
        step.append(1)
    else:
        step.append(step[i-1]+step[i-2])
    
A = []
for j in range(M):
    A.append(int(eval(input())))

stairs = []
flag = 0
old = -1
for a in A:
    if a-old == 1:
        flag = 1
        break
    else:
        stairs.append(a-old-1)
        old = a
stairs.append(N-old)

if flag == 1:
    print((0))
else:
    #print(stairs)
    ans = 1
    for s in stairs:
        ans*=step[s]
        
    print((ans%mod))
# Original solution
# C - Typical Stairs

MOD = (10 ** 9) + 7
INF = float('inf')
N, M = list(map(int, input().split()))
A = [int(eval(input())) for _ in range(M)]
dp = [0] * (N + 1)
dp[0] = 1
if 1 not in A:
    dp[1] = 1

for i in range(2, N + 1):
    if i in A:
        dp[i] = 0
    else:
        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD

print((dp[N]))


# Optimized solution
# C - Typical Stairs

MOD = (10 ** 9) + 7
N, M = list(map(int, input().split()))
A = [False] * (N + 1)
for _ in range(M):
    A[int(eval(input()))] = True
dp = [0] * (N + 1)
dp[0] = 1
if A[1] == False:
    dp[1] = 1

for i in range(2, N + 1):
    if A[i] == True:
        dp[i] = 0
    else:
        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD

print((dp[N]))
# Original solution
n,m=list(map(int,input().split()))
a=[int(eval(input())) for i in range(m)]
mod=10**9+7
d=[0]*(n+1)
d[0]=1 
if 1 in a:
  d[1]=0
else:
  d[1]=1
for i in range(2,n+1):
  if i not in a:
    d[i]=(d[i-1]+d[i-2])%mod
print((d[n]))

# Optimized solution
n,m=list(map(int,input().split()))
a=[int(eval(input())) for i in range(m)]
mod=10**9+7
d=[mod]*(n+1)
d[0]=1;d[1]=1
for i in a:
  d[i]=0
for i in range(2,n+1):
  d[i]=min(d[i],(d[i-1]+d[i-2])%mod)
print((d[n]))
# Original solution
N,M=list(map(int,input().split()))
a=[int(eval(input())) for _ in range(M)]

dp=[0]*(N)

for i in range(1,N+1):
    if i==1 and 1 not in a:
        dp[0]=1
    elif i==2:
        if 2 in a:
            dp[1]=0
        else:
            dp[1]+=dp[0]+1

    elif i not in a:
        dp[i-1]=dp[i-2]+dp[i-3]

print((dp[N-1]%1000000007))
    

# Optimized solution
N,M=list(map(int,input().split()))
a=[int(eval(input())) for _ in range(M)]

a.append(N+10)
dp=[0]*(N)
j=0

for i in range(1,N+1):
    if i==1 and 1!=a[j]:
        dp[0]=1
    elif i==2:
        if 2==a[j]:
            dp[1]=0
            j+=1
        else:
            dp[1]=dp[0]+1

    elif i!=a[j]:
        dp[i-1]=dp[i-2]+dp[i-3]
    else:
        j+=1
    

print((dp[N-1]%1000000007))
# Original solution
N, M = list(map(int, input().split()))
MOD = 10 ** 9 + 7
broken = []
for i in range(0, M):
  broken.append(int(eval(input())))

memo = [0] * (N+1)
memo[0] = 1
cnt = 1
while cnt <= N:
  if cnt in broken:
    memo[cnt] = 0
  elif cnt == 1:
    memo[cnt] = 1
  else:
    memo[cnt] = (memo[cnt-1] + memo[cnt-2])%MOD
  cnt += 1
  
print((memo[N]))

# Optimized solution
N, M = list(map(int, input().split()))
MOD = 10 ** 9 + 7
broken = []
for i in range(0, M):
  broken.append(int(eval(input())))

memo = [1]
cnt = 1
while cnt <= N:
  if len(broken) > 0 and cnt == broken[0]:
    del broken[0]
    memo.append(0)
  elif cnt == 1:
    memo.append(1)
  else:
    memo.append((memo[-1] + memo[-2])%MOD)
  cnt += 1
  
print((memo[-1]))
# Original solution
n,m = list(map(int,input().split()))
a = [int(eval(input())) for _ in range(m)]

p = 10**9 +7
ans = [0]*(n+1)
ans[0] = 1
ans[1] = 1
for i in range(1,n):
    if i in a:
        ans[i] = 0
        ans[i+1] = ans[i-1]%p
    else:
        ans[i+1] = (ans[i-1] + ans[i])%p

print((ans[-1]))


# Optimized solution
n,m = list(map(int,input().split()))
a = [int(eval(input())) for _ in range(m)]

p = 10**9 +7
ans = [0]*(n+1)
ans[0] = 1
ans[1] = 1

broken = [0]*(n+1)
for i in a:
    broken[i]= -1

for i in range(1,n):
    if broken[i] == -1:
        ans[i] = 0
        ans[i+1] = ans[i-1]%p
    else:
        ans[i+1] = (ans[i-1] + ans[i])%p

print((ans[-1]))
# Original solution
def main():
    n, m = list(map(int, input().split()))
    a = [int(eval(input())) for _ in range(m)]

    ansls = [0]*(n+1)

    if 0 not in a:
        ansls[0] = 1
    if 1 not in a:
        ansls[1] = 1

    for i in range(2, n+1):
        if i not in a:
            ansls[i] = (ansls[i-2] + ansls[i-1])%(10**9 + 7)
    
    print((ansls[-1]))
    
if __name__ == "__main__":
    main()

# Optimized solution
def main():
    n, m = list(map(int, input().split()))
    a = set([int(eval(input())) for _ in range(m)])

    ansls = [0]*(n+1)
    big = 10**9 + 7

    if 0 not in a:
        ansls[0] = 1
    if 1 not in a:
        ansls[1] = 1

    for i in range(2, n+1):
        if i not in a:
            ansls[i] = (ansls[i-2] + ansls[i-1])%big
    
    print((ansls[-1]))
    
if __name__ == "__main__":
    main()
# Original solution
def main():
    n, m = list(map(int, input().split()))
    a = [int(eval(input())) for _ in range(m)]

    ansls = [0]*(n+1)

    if 0 not in a:
        ansls[0] = 1
    if 1 not in a:
        ansls[1] = 1

    for i in range(2, n+1):
        if i not in a:
            ansls[i] = (ansls[i-2] + ansls[i-1])%(10**9 + 7)
    
    print((ansls[-1]))
    
if __name__ == "__main__":
    main()


# Optimized solution
def main():
    n, m = list(map(int, input().split()))
    a = set([int(eval(input())) for _ in range(m)])

    ansls = [0]*(n+1)

    if 0 not in a:
        ansls[0] = 1
    if 1 not in a:
        ansls[1] = 1

    for i in range(2, n+1):
        if i not in a:
            ansls[i] = (ansls[i-2] + ansls[i-1])%(10**9 + 7)
    
    print((ansls[-1]))
    
if __name__ == "__main__":
    main()
# Original solution
n,m = list(map(int,input().split()))
a = ([int(eval(input())) for i in range(m)])
inf = 1000000007

dp = [0] * (n+1)
dp[0] = 1

if 1 not in a:
    dp[1] = 1
else:
    dp[1] = 0

for i in range(2,n+1):
    if i in a:
        continue
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= inf

print((dp[n]))

# Optimized solution
n,m = list(map(int,input().split()))
a = set([int(eval(input())) for i in range(m)])
inf = 1000000007

dp = [0] * (n+1)
dp[0] = 1

if 1 not in a:
    dp[1] = 1
else:
    dp[1] = 0

for i in range(2,n+1):
    if i in a:
        continue
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= inf

print((dp[n]))
# Original solution
N,M=list(map(int,input().split()))
mod=10**9+7
dp=[0 for i in range(N+1)]
dp[0]=1
a=[int(eval(input())) for i in range(M)]
isbroken=[1 for i in range(N+1)]
for i in range(M):
    isbroken[a[i]]=0
for i in range(N):
    if i-1>=0:
        dp[i+1]=dp[i]*isbroken[i]+dp[i-1]*isbroken[i-1]
    else:
        dp[i+1]=dp[i]*isbroken[i]
    dp[i+1]%=mod
print((dp[N]))


# Optimized solution
N,M=list(map(int,input().split()))
mod=10**9+7
isbroken=[1 for i in range(N+1)]
dp=[0 for i in range(N+1)]
dp[0]=1
for i in range(M):
    ai=int(eval(input()))
    isbroken[ai]=0
for i in range(N):
    dp[i+1]=isbroken[i]*dp[i]+isbroken[i-1]*dp[i-1]
    dp[i+1]%=mod
print((dp[N]))
# Original solution
MOD = 10 ** 9 + 7

N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
broken = [False] * (N + 1)
for aa in a:
    broken[aa] = True

dp = [0] * (N + 1)
dp[0] = 1

for i in range(1, N + 1):
    if broken[i]:
        continue
    if i >= 2:
        dp[i] = dp[i - 1] + dp[i - 2]
    else:
        dp[i] = dp[i - 1]
    dp[i] %= MOD
print((dp[N]))


# Optimized solution
mod = 10 ** 9 + 7

n, m = list(map(int, input().split()))
a = tuple(int(eval(input())) for _ in range(m))
b = [False] * (n + 1)
for aa in a:
    b[aa] = True

dp = [0] * (n + 5)
dp[0] = 1

for i in range(n):
    if not b[i]:
        dp[i + 1] += dp[i]
        dp[i + 1] %= mod
        dp[i + 2] += dp[i]
        dp[i + 2] %= mod
print((dp[n]))