CodeEff/ECCO huggingface dataset:
# Original solution
import math
import sys

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

def nCr(n, r):
  c = math.factorial(n) // (math.factorial(n-r) * math.factorial(r))
  return c

for i in range(m-1):
  if a[i] + 1 == a[i+1]:
    print('0')

    sys.exit()


a.insert(0, -1)
a.append(n+1)

cnt = 1

for i in range(m+1):
  step = (a[i+1] - 1) - (a[i] + 1)
  pattern = 1
  for j in range(1, step//2 + 1):
    k = j
    if j > (step - j) // 2:
      k = step - 2*j
    pattern += nCr(step - j, k)
  cnt *= pattern

print((cnt%1000000007))

# Optimized solution
n,m = list(map(int, input().split()))
step = []

now = 0
for i in range(m):
  next = int(eval(input())) - 1
  step.append(next - now)
  now = next + 2

step.append(n-now)  
step.sort()

def fibo():
  s = []
  a = 1
  b = 1
  s.append(a)
  s.append(b)
  for i in range(n):
    c = a+b
    a = b
    b = c
    s.append(c)
  return s

ans = 1

if step[0] < 0:
  ans = 0

else:
  f = fibo()
  for i in step:
    ans *= f[i]

print((ans % 1000000007))
# Original solution
# 再帰上限あげとく
import sys
sys.setrecursionlimit(10**6)

# 値入力
mod = 7+10**9
N,M = list(map(int, input().split()))
a = [0]*M
for i in range(M):
    a[i] = int(eval(input()))

# メモ化フィボナッチ
# 参考:http://python-remrin.hatenadiary.jp/entry/2017/05/19/153228
fib_memo = {}
def fib(n):
    if n < 3: return 1
    if n not in fib_memo:
        fib_memo[n] = fib(n-1) + fib(n-2)
    return fib_memo[n]

now = 0 # 今いる場所と考える
count = 1
for i in a:
    count *= fib(i-now)
    count = count%mod
    if now == i:
        print((0))
        quit()
    now = i+1 # 穴を超えた次の段に移動する

# 最上段までを計算
count *= fib(N-now+1)
print((count%mod))

# Optimized solution
# 再帰上限あげとく
import sys
sys.setrecursionlimit(10**6)

# 値入力
mod = 7+10**9
N,M = list(map(int, input().split()))
a = [0]*M
for i in range(M):
    a[i] = int(eval(input()))

# メモ化フィボナッチ
# 参考:http://python-remrin.hatenadiary.jp/entry/2017/05/19/153228
memo = [0]*(N+2)
def fibonacci(n):
    if n < 3:
        return 1
    if memo[n] < 1:
        memo[n] = fibonacci(n-1) + fibonacci(n-2)
    return memo[n]

now = 0 # 今いる場所と考える
count = 1
for i in a:
    count *= fibonacci(i-now)
    count = count%mod
    if now == i:
        print((0))
        quit()
    now = i+1 # 穴を超えた次の段に移動する

# 最上段までを計算
count *= fibonacci(N-now+1)
print((count%mod))
# Original solution
N, M = list(map(int, input().split()))
MOD = 10 ** 9 + 7

a = [int(eval(input())) for _ in range(M)]

dp = [0 for _ in range(N + 1)]
dp[0] = 1

for now in range(N):
    for next in range(now + 1, min(N + 1, now + 3)):
        if next not in a:
            dp[next] += dp[now]
            dp[next] = dp[next] % MOD

print((dp[N]))


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

is_broken = [False for _ in range(N + 1)]
for _ in range(M):
    a = int(eval(input()))
    is_broken[a] = True

dp = [0 for _ in range(N + 1)]
dp[0] = 1

for i in range(1, N + 1):
    if is_broken[i]:
        continue
    if i == 1:
        dp[i] += dp[i - 1]
    else:
        dp[i] += dp[i - 1] + dp[i - 2]

    dp[i] = dp[i] % MOD

print((dp[N]))
# Original solution
N, M = list(map(int, input().split()))
MOD = 10 ** 9 + 7

is_broken = [False for _ in range(N + 1)]
for _ in range(M):
    a = int(eval(input()))
    is_broken[a] = True

dp = [0 for _ in range(N + 1)]
dp[0] = 1

for i in range(1, N + 1):
    if is_broken[i]:
        continue
    if i == 1:
        dp[i] += dp[i - 1]
    else:
        dp[i] += dp[i - 1] + dp[i - 2]

    dp[i] = dp[i] % MOD

print((dp[N]))


# Optimized solution
import sys

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


def input():
    return sys.stdin.readline().strip()


def main():
    N, M = list(map(int, input().split()))
    dp = [0] * (N + 1)
    safe = [True] * (N + 1)
    for _ in range(M):
        a = int(eval(input()))
        safe[a] = False

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

    print((dp[-1]))


if __name__ == "__main__":
    main()
# Original solution
n, m = [int(e) for e in input().split()]
a = set(int(eval(input())) for i in range(m))
t = [0] * (n + 2)
t[0] = 1
for i in range(n):
  if i in a:
    t[i] = 0
  else:
    t[i + 1] = (t[i + 1] + t[i]) % 1000000007
    t[i + 2] = (t[i + 2] + t[i]) % 1000000007
print((t[n]))


# Optimized solution
# DP(動的計画法)
N, M = list(map(int, input().split()))
A = set(int(eval(input())) for _ in range(M))

m = 1000000007

t = [0] * (N + 2)
t[0] = 1
for i in range(N):
    if i in A:
        t[i] = 0
    else:
        t[i + 1] = (t[i + 1] + t[i]) % m
        t[i + 2] = (t[i + 2] + t[i]) % m
print((t[N]))
# Original solution
#!/home/ryo/.pyenv/versions/anaconda3-2019.03/envs/hoge/bin/python
import sys

lim=10**9+7
N,M = list(map(int,input().split()))
A=[]
for i in range(0,M):
    A.append(int(eval(input())))

memo = [0] * (N+1)
memo[0]=1
for i in range(0,M-1):
    if A[i+1] - A[i] == 1:
        print((0))
        sys.exit()
if not 1 in A:
    memo[1]=1
for i in range(2, N+1):
    if not i in A:
        memo[i] = (memo[i - 1] + memo[i - 2]) % lim
print((memo[-1]))


# Optimized solution
#!/home/ryo/.pyenv/versions/anaconda3-2019.03/envs/hoge/bin/python
import sys

lim=10**9+7
N,M = list(map(int,input().split()))
A = set([int(eval(input())) for _ in range(M)])
memo = [0] * (N+1)
memo[0]=1

if not 1 in A:
    memo[1]=1
for i in range(2, N+1):
    if not i in A:
        memo[i] = (memo[i - 1] + memo[i - 2]) % lim
print((memo[-1]))
# Original solution
N,M=list(map(int,input().split()))
num=[0]*(N+1)
num[0]=1
num[1]=1

A=[]
for i in range(M):
    A.append(int(eval(input())))

P=10**9+7

if 1 in A:
    num[1]=0

if N>=2:
    for i in range(2,N+1):
        num[i]=(num[i-1]+num[i-2])%P
        if i in A:
            num[i]=0

print((num[N]))

# Optimized solution
N,M=list(map(int,input().split()))
num=[0]*(N+1)
num[0]=1
num[1]=1

A=[]
for i in range(M):
    A.append(int(eval(input())))

P=10**9+7
index=0

if 1 in A:
    num[1]=0
    index+=1


if N>=2:
    for i in range(2,N+1):
        num[i]=(num[i-1]+num[i-2])%P
        if index<=M-1 and i==A[index]:
            num[i]=0
            index+=1

print((num[N]))
# 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

if 1 in a:
  dp[1]=0
else:
  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])%(10**9+7)
    
print((dp[n]))

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

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

dp[0]=1

dp[1]=1

for i in a:
  dp[i]=0
  

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


# Optimized solution
mod = pow(10,9)+7
N,M = list(map(int,input().split()))
A = [int(eval(input())) for i in range(M)]+[mod]
DP = [1]
k = 0
for i in range(1,N+1):
    if i==A[k]:
        DP.append(0)
        k+=1
    else:
        a = DP[i-1]
        b = DP[i-2] if i>1 else 0
        DP.append((a+b)%mod)
print((DP[N]%mod))
# Original solution
n, m = list(map(int, input().split()))
broken = [int(eval(input())) for _ in range(m)]

ways = [0] * (n+1)
ways[0] = 1
keep = 1
noway = False
for i in range(1, n+1):
  if i in broken:
    if i-1 in broken:
      noway = True
      break
    ways[i] = ways[i-1]
    keep = 0
  else:
    if keep == 2:
      ways[i] = ways[i-1] + ways[i-2]
    else:
      ways[i] = ways[i-1]
      keep += 1
      
print((ways[-1] % 1000000007 if not noway else 0))

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

ways = [1] * (n+1)
for i in broken:
  ways[i] = 0
  
keep = 1
for i in range(1, n+1):
  if ways[i]:
    if keep == 2:
      ways[i] = ways[i-1] + ways[i-2]
    elif keep == 1:
      ways[i] = ways[i-1]
      keep += 1
    else:
      ways[i] = ways[i-2]
      keep += 1
  else:
    keep = 0
      
print((ways[-1] % 1000000007))
# Original solution

def main(N, M, a):
    dp = [0] * (N+1)
    dp[0] = 1
    dp[1] = 1 if 1 not in a else 0
    for i in range(2, len(dp)):
        dp[i] = dp[i-1] + dp[i-2] if i not in a else 0
    return dp[-1] % (10**9+7)

N, M = list(map(int, input().split()))
a = list(int(eval(input())) for _ in range(M))
print((main(N,M,a)))

# Optimized solution

def main(N, M, a):
    dp = [-1] * (N+1)
    dp[0] = 1
    dp[1] = 1
    for i in a :
        dp[i] = 0
    for i in range(2, len(dp)):
        dp[i] = dp[i-1] + dp[i-2] if dp[i] != 0 else 0
    return dp[-1] % (10**9+7)

N, M = list(map(int, input().split()))
a = list(int(eval(input())) for _ in range(M))
print((main(N,M,a)))
# Original solution
def main():
    n, m = list(map(int, input().split()))
    dp = [0] * (n + 1)
    dp[0] = 1
    for _ in range(m):
        a = int(eval(input()))
        dp[a] = -1
    mod = 10 ** 9 + 7

    for i in range(n + 1):
        if dp[i] != -1:
            if i + 1 <= n and dp[i + 1] != -1:
                dp[i + 1] = (dp[i + 1] + dp[i]) % mod
            if i + 2 <= n and dp[i + 2] != -1:
                dp[i + 2] = (dp[i + 2] + dp[i]) % mod

    print((dp[-1] % mod))


if __name__ == "__main__":
    main()


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

    for i in range(n + 1):
        if dp[i] == 0:
            if i - 1 >= 0 and dp[i - 1] != -1:
                dp[i] = (dp[i] + dp[i - 1]) % mod
            if i - 2 >= 0 and dp[i - 2] != -1:
                dp[i] = (dp[i] + dp[i - 2]) % mod

    print((dp[-1] % mod))


if __name__ == "__main__":
    main()
# Original solution
from functools import lru_cache
import sys
sys.setrecursionlimit(10**6)

def main(N, M, a_list):
    div = 10**9 + 7
    @lru_cache(maxsize=None)
    def fib(n):
        if n in a_list:
            return 0
        else:
            if n == -1:
                return 0
            elif n == 0 or n == 1:
                return 1
            else:
                return fib(n-1) % div + fib(n-2) % div
    
    
    print((fib(N) % div ))


if __name__ == "__main__":
    N, M = [int(x) for x in input().split()]
    a_list = []
    for _ in range(M):
        a_list.append(int(eval(input())))

    main(N, M, a_list)


# Optimized solution
from functools import lru_cache
import sys
sys.setrecursionlimit(10**6)

def main(N, M, a_list):
    div = 10**9 + 7
    @lru_cache(maxsize=None)
    def fib(n):
        if n in a_list:
            return 0
        else:
            if n == -1:
                return 0
            elif n == 0 or n == 1:
                return 1
            else:
                return fib(n-2) % div + fib(n-1) % div
    
    
    print((fib(N) % div ))


if __name__ == "__main__":
    N, M = [int(x) for x in input().split()]
    a_list = []
    for _ in range(M):
        a_list.append(int(eval(input())))

    main(N, M, a_list)
# Original solution
def main(N, M, a_list):
    div = 10**9 + 7
    
    dp = {}
    dp[0] = 1
    if 1 in a_list:
        dp[1] = 0
    else:
        dp[1] = 1

    for i in range(N):
        if i+2 in a_list:
            dp[i+2] = 0
        else:
            dp[i+2] = (dp[i+1] + dp[i])
    
    print((dp[N] % div))


if __name__ == "__main__":
    N, M = [int(x) for x in input().split()]
    a_list = []
    for _ in range(M):
        a_list.append(int(eval(input())))

    main(N, M, a_list)


# Optimized solution
def main(N, M, a_list):
    div = 10**9 + 7

    a_set = set(a_list)
    
    dp = {}
    dp[0] = 1
    if 1 in a_set:
        dp[1] = 0
    else:
        dp[1] = 1

    for i in range(N):
        if i+2 in a_set:
            dp[i+2] = 0
        else:
            dp[i+2] = (dp[i+1] + dp[i])
    
    print((dp[N] % div))


if __name__ == "__main__":
    N, M = [int(x) for x in input().split()]
    a_list = []
    for _ in range(M):
        a_list.append(int(eval(input())))

    main(N, M, a_list)
# Original solution
N,M=[int(i) for i in input().split()]
inf=1000000007
aa=[]
for i in range(M):
	aa.append(int(eval(input())))
dp=[0]*(N+1)
dp[0]=1
if 1 in aa:
	dp[1]=0
else:
	dp[1]=1
for i in range(2,N+1):
	if i in aa:
		dp[i]=0
	else:
		dp[i]=dp[i-2]%inf+dp[i-1]%inf
print((dp[N]%inf))

# Optimized solution
N,M=[int(i) for i in input().split()]
inf=1000000007
dp=[-1]*(N+1)
for i in range(M):
	dp[int(eval(input()))]=0
dp[0]=1
if dp[1]==-1:
	dp[1]=1
for i in range(2,N+1):
	if dp[i]==0:
		continue
	else:
		dp[i]=(dp[i-2]+dp[i-1])%inf
print((dp[N]%inf))
# Original solution
N, M = list(map(int, input().split()))

a = [int(eval(input())) for _ in range(M)]

dp = [0] * (N + 1)

dp[0] = 1

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

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

print((dp[-1]))




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

# a = [int(input()) for _ in range(M)]
a = set([int(eval(input())) for _ in range(M)])

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

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

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

print((dp[-1]))
# Original solution
import math
n, m = list(map(int, input().split()))
now_step = 0
checked_steps = {}
factorial_dict = {}
divide_num = 1000000007 

def count_steps(number):
    global checked_steps
    global factorial_dict
    if(number in list(checked_steps.keys())):
        return checked_steps[number]
    # count=1*a+2*bとなるような、0以上の全てのa,bについて、1をa個、2をb個並べる並べ方を返す.
    # [1,(a+b)]からa個を選ぶ選び方と同じ
    # 余り残は和・積に関して分割法則が成り立つので1,000,000,007 で割ってもいい
    counter = 0
    for i in range(0, number + 1, 2):
        a = number - i
        b = i // 2
        if((a+b) not in factorial_dict):
            factorial_dict[a+b] = math.factorial(a+b)
        if(a not in factorial_dict):
            factorial_dict[a] = math.factorial(a)
        if(b not in factorial_dict):
            factorial_dict[b] = math.factorial(b)
        counter += factorial_dict[a+b] // (factorial_dict[a] * factorial_dict[b])
    checked_steps[number] = counter % divide_num
    return checked_steps[number]

all_count = 1
for i in range(m):
    a = int(eval(input()))
    all_count = (all_count * count_steps(a - 1 - now_step)) % divide_num
    now_step = a + 1
all_count = (all_count * count_steps(n - now_step)) % divide_num
print((all_count % divide_num))

# Optimized solution
n, m = list(map(int, input().split()))
now_step = 0
# count=1*a+2*bとなるような、0以上の全てのa,bについて、1をa個、2をb個並べる並べ方を返す.
# [1,(a+b)]からa個を選ぶ選び方と同じ
# ただし、これはnumber-1とnumber-2が分かっている場合は、number-1から1つ、あるいはnumber-2から二つ進む進み方の和で表せる
# よって、counte_steps(number) = count_steps(number-1) + count_steps(number-2)
# 初期値はcount_steps(1) = 1, count_steps(2) = 2,count_steps(0) = 1
checked_steps = {-1:0, 0:1, 1:1}
divide_num = 1000000007 

for i in range(2, n+1):
    checked_steps[i] = (checked_steps[i-1] + checked_steps[i-2]) % divide_num

all_count = 1
for i in range(m):
    a = int(eval(input()))
    if(a < now_step):
        continue
    all_count = (all_count * checked_steps[a - 1 - now_step]) % divide_num
    now_step = a + 1
all_count = (all_count * checked_steps[n - now_step]) % divide_num
print(all_count)
# Original solution
n,m=list(map(int,input().split()))
a=[]
for i in range(m):
  a.append(int(eval(input())))
b=[0 for x in range(n+1)]
b[0]=1
for i in range(1,n+1):
  if i in a:
    continue
  x=b[i-1]
  if i>1:x+=b[i-2]
  b[i]=x
print((b[n]%(10**9+7)))

# Optimized solution
n,m=list(map(int,input().split()))
a=[]
a = set(int(eval(input())) for _ in range(m))
#for i in range(m):
#  a.append(int(input()))
b=[0 for x in range(n+1)]
b[0]=1
for i in range(1,n+1):
  if i in a:
    continue
  x=b[i-1]
  if i>1:x+=b[i-2]
  b[i]=x
print((b[n]%(10**9+7)))
# Original solution
n,m=list(map(int,input().split()))
a = set(int(eval(input())) for i in range(m))
#for i in range(m):
#  a.append(int(input()))
b=[0 for x in range(n+1)]
b[0]=1
for i in range(1,n+1):
  if i in a:
    continue
  x=b[i-1]
  if i>1:x+=b[i-2]
  b[i]=x
print((b[n]%(10**9+7)))

# Optimized solution
n,m=list(map(int,input().split()))
a = set(int(eval(input())) for i in range(m))
#for i in range(m):
#  a.append(int(input()))
b=[0 for x in range(n+1)]
b[0]=1
for i in range(1,n+1):
  if i in a:
    continue
  x=b[i-1]
  if i>1:x+=b[i-2]
  b[i]=x%(10**9+7)
print((b[n]))
# Original solution
n, m = [int(i) for i in input().split()]
a = []
for _ in range(m):
    a.append(int(eval(input())))

ways = [0] * 3
ways[1] = 0 if 1 in a else 1
ways[2] = 0 if 2 in a else ways[1] + 1
for i in range(3, n+1):
    if i in a:
        ways.append(0)
    else:
        ways.append((ways[-2]+ways[-1])%(10**9+7))

print((ways[n]))


# Optimized solution
n, m = [int(i) for i in input().split()]
a = []
broken = [False] * max(n+1, 3)
for _ in range(m):
    i = int(eval(input()))
    a.append(i)
    broken[i] = True

ways = [0] * 3
ways[1] = 0 if broken[1] else 1
ways[2] = 0 if broken[2] else ways[1] + 1
for i in range(3, n+1):
    if broken[i]:
        ways.append(0)
    else:
        ways.append((ways[-2]+ways[-1])%(10**9+7))

print((ways[n]))
# Original solution
import sys
sys.setrecursionlimit(10**6)
from functools import lru_cache


n,m=list(map(int,input().split()))
A = [int(eval(input())) for i in range(m)]
mod = 10**9+7
memo={}
memo[1]=1
memo[0]=1

@lru_cache(maxsize=10000000)
def fib(n):
  if n in A:
  	memo[n]=0
  	return 0
  if n not in memo:
    memo[n] = fib(n-1) + fib(n-2)
  return memo[n]

print((fib(n)%mod))

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

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

list1 = []
for i in range(m):
    list1.append(int(eval(input())))

dp = [0]*(n+1)
dp[0] = 1
if not 1 in list1: 
	dp[1] = 1 #i+2まで考えるため、初期設定はi = 1まで必要
for i in range(n-1):
	if i not in list1:
		dp[i+2] += dp[i]
	if i+1 not in list1:
		dp[i+2] += dp[i+1]

print((dp[n]%1000000007))

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


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

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

if dp[1] != -1:
	dp[1] = 1

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

print((dp[n]%1000000007))
# Original solution
N, M = list(map(int, input().split()))
S = [True]*(N+1)
for _ in range(M):
  a = eval(input())
  S[a] = False
T = [0]*(N+1)
T[0] = 1
T[1] = 1 if S[1] else 0
for i in range(2, N+1):
  if S[i]:
    T[i] = (T[i-1]+T[i-2])%1000000007
print(T[N])

# Optimized solution
N, M = list(map(int, input().split()))
S = [True]*(N+1)
for _ in range(M):
  a = int(eval(input()))
  S[a] = False
T = [0]*(N+1)
T[0] = 1
T[1] = 1 if S[1] else 0
for i in range(2, N+1):
  if S[i]:
    T[i] = (T[i-1]+T[i-2])%1000000007
print((T[N]))
# Original solution
#

import itertools
from collections import Counter
from collections import defaultdict
import bisect
from heapq import heappush, heappop

def main():
    MOD = 1000000007

    N, M = list(map(int, input().split()))
    A = set()
    for _ in range(M):
        a = int(eval(input()))
        A.add(a)

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

    # print(dp)
    print((dp[N] % MOD))


if __name__ == '__main__':
    main()


# Optimized solution
#

import itertools
from collections import Counter
from collections import defaultdict
import bisect
from heapq import heappush, heappop

def main():
    MOD = 1000000007

    N, M = list(map(int, input().split()))
    A = set()
    for _ in range(M):
        a = int(eval(input()))
        A.add(a)

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

    # print(dp)
    ans = dp[N] % MOD
    print(ans)


if __name__ == '__main__':
    main()
# Original solution

import sys
input = sys.stdin.readline
def isSafe(position):
    return not position in listM


STEP = 2
N,M = list(map(int,input().split()))
dp = [0] * (N+1)
cnt = 0


listM=[int(eval(input())) for i in range(M)]
dp[0] = 1

for i in range(N):
    if i+1 > N:
        break
    if isSafe(i+1):
        dp[i+1] += dp[i]
    if i+2 > N:
        break
    if isSafe(i+2):
        dp[i+2] += dp[i]
        #dp[j] = 0
    #print(dp)
        
print((dp[N] % 1000000007))

# Optimized solution

import sys
input = sys.stdin.readline
def isSafe(position):
    return not position in listM
 
 
STEP = 2
N,M = list(map(int,input().split()))
dp = [0] * (N+1)
cnt = 0
 
 
listM={int(eval(input())) for i in range(M)}
dp[0] = 1
 
for i in range(N):
    if i+1 > N:
        break
    if isSafe(i+1):
        dp[i+1] += dp[i]
    if i+2 > N:
        break
    if isSafe(i+2):
        dp[i+2] += dp[i]
        #dp[j] = 0
    #print(dp)
        
print((dp[N] % 1000000007))
# Original solution
N, M = list(map(int, input().split()))
dp = [0] * N
for _ in range(M):
    a = int(eval(input()))
    dp[a-1] = -1

k = 1000000007


for i in range(N):
    if dp[i] == -1:
        dp[i] = 0
        continue
    if i == 0:
        dp[i] = 1
        continue
    if i == 1:
        dp[i] = dp[i-1] + 1
        continue

    dp[i] = dp[i-1] + dp[i-2]

n = dp[-1] % k

print(n)


# Optimized solution
N, M = list(map(int, input().split()))
dp = [0] * N
for _ in range(M):
    a = int(eval(input()))
    dp[a-1] = -1

k = 1000000007


for i in range(N):
    if dp[i] == -1:
        dp[i] = 0
        continue
    if i == 0:
        dp[i] = 1
        continue
    if i == 1:
        dp[i] = dp[i-1] + 1
        continue

    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= k



print((dp[-1]))
# Original solution
n,m=list(map(int,input().split()))
mod=10**9+7
t=[int(eval(input())) for i in range(m)] 
dp=[-1]*(n+1)

dp[0]=1
dp[1]=1
for i in range(m):
    dp[t[i]]=0


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


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

dp[0]=1 #0が１なのは２段目の回答を合わせるためdp[０]＝０、dp[1]=0,ds[2]=1
#は入力が1,0のきエラーになるので、だめ
dp[1]=1
for i in range(m):
    dp[t[i]]=0#ここはそもそもいけないので０になる


for i in range(2,n+1):
    if dp[i]==-1:
        dp[i]=dp[i-1]+dp[i-2]#このばしょにくるほうほうは二個前からくるか一個前からくるか、そこのあたいをたっせばいい
print((dp[-1]%mod))
# Original solution
n,m = list(map(int,input().split()))
brokensteps = [int(eval(input())) for x in range(m)]
dp = [0] * (n+1)
for i in range(n+1):
    if i in brokensteps:
        dp[i] = 0
        continue
    
    elif i <= 1:
        dp[i] = 1

    else:
        dp[i] = (dp[i-1]%(10**9+7) + dp[i-2]%(10**9+7))%(10**9+7)

print((dp[n]))

# Optimized solution
n,m = list(map(int,input().split()))
brokensteps = set([int(eval(input())) for x in range(m)])
dp = [0] * (n+1)
for i in range(n+1):
    if i in brokensteps:
        dp[i] = 0
        continue
    
    elif i <= 1:
        dp[i] = 1

    else:
        dp[i] = (dp[i-1] + dp[i-2])%(10**9+7)

print((dp[n]))