CodeEff/ECCO huggingface dataset:
# Original solution
from collections import Counter
n, m = list(map(int, input().split()))
l = []
a0 = 0
for i in range(m):
    a = int(eval(input()))
    if a - a0 == 0:
        print((0))
        exit()
    l.append(a - a0 - 1)
    a0 = a + 1
l.append(n - a0)
d = Counter(l)
key = list(d.keys())

def cmb(n, r):
    if r > n//2:
        r = n - r
    val = 1
    for i in range(r):
        val *= n - i
        val //= i + 1
    return val

ans = 1
for k in key:
    val = 0
    for i in range(k//2 + 1):
        val += cmb(k - i, i)
    ans *= val**d[k]
    ans %= 10**9 + 7
print(ans)

# Optimized solution
from collections import Counter
n, m = list(map(int, input().split()))
l = []
a0 = 0
for i in range(m):
    a = int(eval(input()))
    if a - a0 == 0:
        print((0))
        exit()
    l.append(a - a0 - 1)
    a0 = a + 1
l.append(n - a0)
d = Counter(l)
key = list(d.keys())

ma = max(key)
fib = [1]*(ma + 1)
for i in range(2, ma + 1):
    fib[i] = fib[i - 2] + fib[i - 1]

ans = 1
for k in key:
    ans *= fib[k]**d[k]
    ans %= 10**9 + 7

print(ans)
# Original solution
n, m = list(map(int, input().split()))
a = [0] + [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
MOD = 10 ** 9 + 7

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

print((dp[-1]))


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

ok = [True] * (n + 1)
for v in a:
    ok[v] = False

dp = [0] * (n + 1)
dp[0] = 1
if 1 in a:
    dp[1] = 0
else:
    dp[1] = 1
MOD = 10 ** 9 + 7

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

print((dp[-1]))
# Original solution
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 13 12:06:59 2020

@author: liang
"""


key = 10**9 + 7
N, M = list(map(int, input().split()))

A = [int(eval(input())) for _ in range(M)]
A.sort()
A += [-1]

def solve():
    steps = list()
    count = 0
    index = 0
    #段差数え
    for i in range(N+1):
        if i == A[index]:
            if count == 0:
                return 0
            else:
                steps.append(count)
                count = 0
                if index < M:
                    index += 1
        else:
            count += 1
    else:
         steps.append(count)
         count = 0
        
    smax = max(steps)
    fibs = [0] * smax
    #fibテーブル生成 O(n)
    for i in range(smax):
        if i == 0 or i == 1:
            fibs[i] = 1
        else:
            fibs[i] = fibs[i-1] + fibs[i-2]  
    else:
        ans = 1
        for s in steps:
            #print(s)
            ans *= fibs[s-1]
            #print(ans)
            ans %= key
    #print(A)
    #print(steps)
    #print(fibs)
    return ans

ans = solve()        
print(ans)

# Optimized solution
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 13 12:37:37 2020

@author: liang
"""

"""
フィボナッチ数列生成
【DP(?)】　: 配列を使用することで計算量が爆発するのを防ぐ
【小さいものから計算する】の原則

【方針】
　通常の配列を用いたフィボナッチ数列の生成方法の応用版
 壊れた階段のフィボナッチ数列の値を　0 にすることで、実質遷移を止めることが出来る。
"""
key = 10**9 + 7
N, M = list(map(int, input().split()))
A = [int(eval(input())) for _ in range(M)]+[-1]

fibs = [0]*(N+1)
index = 0
for i in range(N+1):
    #壊れたところの値を0にすれば良い
    if i == A[index]:
        fibs[i] = 0
        index += 1
    elif i == 0 or i == 1:
        fibs[i] = 1
    else:
        fibs[i] = (fibs[i-1] + fibs[i-2])%key
        

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


# Optimized solution
n,m=list(map(int,input().split()))
alis=set([])
for i in range(m):
	a=int(eval(input()))
	alis.add(a)
if 1 in alis:
	dp=[1,0]
else:
	dp=[1,1]
for i in range(2,n+1):
	if i in alis:
		d=0
		dp.append(d)
	else:
		d=dp[i-2]+dp[i-1]
		dp.append(d)
print((dp[n]%(10**9+7)))
# Original solution
### 解説読んでから書いたコード
n, m = list(map(int, input().split()))
MOD = 1000000007
if m > 0:
    a = [int(eval(input())) for i in range(m)]
else:
    a = []

a.append(-1)
a_i = 0

step = [0] * (n+2)
step[-1] = -1
step[0] = 1
for i in range(1, n+1):
    if a[a_i] == i:
        step[i] = -1
        a_i += 1
    else:
        if step[i-2] == step[i-1] == -1:
            print((0))
            exit()
        elif step[i-2] == -1 or step[i-1] == -1:
            step[i] = max(step[i-2], step[i-1])
        else:
            step[i] = (step[i-2] + step[i-1]) % MOD
            
print((step[n]))

# Optimized solution
### 解説読んでから書いたコード ###

n, m = list(map(int, input().split()))
MOD = 1000000007
if m > 0:
    a = [int(eval(input())) for i in range(m)]
else:
    a = []

a.append(-1) # 末尾に-1を追加(壊れている床がもう無い事を示す)
a_i = 0

## n段目への移動方法は、step[n]通り存在する
## step[n] = step[n-2] + step[n-1]

step = [0] * (n+2)
step[-1] = -1 # 存在しない段(計算用)
step[0] = 1 # 0段目は1通り

for i in range(1, n+1):
    if a[a_i] == i:
        step[i] = -1 # 壊れている床は-1
        a_i += 1
    else:
        if step[i-2] == step[i-1] == -1:
            print((0)) # 2段続けて壊れている場合は0通り
            exit()
        elif step[i-2] == -1 or step[i-1] == -1:
            step[i] = max(step[i-2], step[i-1]) # [1,2]段前が壊れている場合
        else:
            step[i] = (step[i-2] + step[i-1]) % MOD # 通常の場合

print((step[n]))
# Original solution
import sys
import os

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M = list(map(int, sys.stdin.buffer.readline().split()))
    A = [int(sys.stdin.buffer.readline().rstrip()) for _ in range(M)]

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

    print((ret[-1] % MOD))


if __name__ == '__main__':
    main()


# Optimized solution
import sys
import os

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M = list(map(int, sys.stdin.buffer.readline().split()))
    A = set([int(sys.stdin.buffer.readline().rstrip()) for _ in range(M)])

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

    print((ret[-1] % MOD))


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

sys.setrecursionlimit(10000000)
import os
import math
import bisect
import collections
import itertools
import heapq
import re
import queue

# import fractions

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M = il()
    A = set(iln(M))
    dp = [0]*(N+1)
    dp[0] = 1

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


if __name__ == '__main__':
    main()


# Optimized solution
import sys

sys.setrecursionlimit(10000000)
import os
import math
import bisect
import collections
import itertools
import heapq
import re
import queue

# import fractions

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M = il()
    A = set(iln(M))
    dp = [0]*(N+1)
    dp[0] = 1

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


if __name__ == '__main__':
    main()
# Original solution
N, M = list(map(int, input().split()))
List = [int(eval(input())) for _ in range(M)]

P = 10**9+7
dp = [1]*(N+1)

for i in List:
    dp[i]=0

for j in range(1, N):
    if dp[j+1]!=0:
        dp[j+1] = dp[j]+dp[j-1]
        
print((dp[N]%P))

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

P = 10**9+7
dp = [1]*(N+1)

for i in List:
    dp[i]=0

for j in range(1, N):
    if dp[j+1]!=0:
        dp[j+1] = (dp[j]+dp[j-1])%P
        
print((dp[N]))
# Original solution
from collections import defaultdict as dd
n,m=[int(i) for i in input().split()]
brkn = dd(int)
mod = 10**9+7
for i in range(m):
    num = int(eval(input()))
    brkn[num]+=1
dp = [0]*(n+1)
dp[0]=1
if(1 in brkn):
    dp[1]=0
else:
    dp[1]=1
for i in range(2,n+1):
    if(i in brkn):
        dp[i]=0
    else:
        dp[i] = (dp[i-1]+ dp[i-2])%mod
print((dp[n]))
        


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

from collections import defaultdict as dd
n,m=[int(i) for i in input().split()]
brkn = dd(int)
mod = 10**9+7
for i in range(m):
    num = int(eval(input()))
    brkn[num]+=1
dp = [-1]*(n+1)

def func(curr):
    if(curr==0):
        dp[0]=1
        return dp[0]
    if(curr>0 and (curr in brkn)):
        dp[curr]=0
        return dp[curr]%mod
    if(curr==1):
        dp[1]=1
        return dp[1]
    if(dp[curr]!=-1):
        return dp[curr]%mod
    else:
        dp[curr] =  (func(curr-1) + func(curr-2))%mod
        return dp[curr]%mod

print((func(n)))
# Original solution
import sys
input = sys.stdin.readline

import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

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

if m==0:
    cnt = 0
    steps = n
    for j in range(steps//2+1):
        if j == 0:
            cnt += 1
        else:
            seat = steps - j
            cnt += combinations_count(seat,j)
    print((cnt % (10**9+7)))
    exit()

l = [-1]+[int(eval(input()))]
for i in range(m-1):
    a = int(eval(input()))
    if a == l[-1]+1:
        print((0))
        exit()
    l.append(a)
l.append(n+1)
# print(l)

ans = 1
for i in range(m+1):
    cnt = 0
    steps = l[i+1] - l[i] -2
    for j in range(steps//2+1):
        if j == 0:
            cnt += 1
        else:
            seat = steps - j
            cnt += combinations_count(seat,j)
    ans *= cnt

print((ans % (10**9+7)))


# Optimized solution
import sys
input = sys.stdin.readline

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

dp = [0]*(n+1)
dp[0] = 1
for i in range(n):
    for j in range(i+1,min(n,i+2)+1):
        if oks[j]:
            dp[j] += dp[i]
            dp[j] %= (10**9+7)
print((dp[n]))
# Original solution
N,M=list(map(int,input().split()))
a=[int(eval(input())) for _ in range(M)]
mod=10**9+7
#Dynamic Programming
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])%mod
print((dp[N]))

# Optimized solution
N,M=list(map(int,input().split()))
dp=[0]*(N+1)
dp[0]=1
mod=10**9+7
a=[False for _ in range(N+1)]
for _ in range(M):
    a[int(eval(input()))]=True
    
for i in range(1,N+1):
    if a[i]:
        continue
    dp[i]=(dp[i-1]+dp[i-2])%mod
 
print((dp[N]))
# Original solution
import sys
input = sys.stdin.readline

MOD = 10 ** 9 + 7


def main():
    N, M = list(map(int, input().split()))
    memo = [0] * max((N + 1), 10)
    a = [0] * M

    memo[0] = 1
    memo[1] = 1
    memo[2] = 2
    for i in range(3, max(N+1, 10)):
        memo[i] = memo[i-1] + memo[i-2]

    # print(memo)
    ans = 1

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

        if i != 0 and abs(a[i] - a[i-1]) == 1:
            print((0))
            return

        if a[i] == 1:
            ans *= 1
        elif i == 0:
            ans *= memo[a[i] - 1]
            ans %= MOD
            # print(a[i], ans, a[i] - 1)
        else:
            ans *= memo[a[i] - a[i-1] - 2]
            ans %= MOD
            # print(a[i], ans, a[i] - a[i-1] - 2)

    if M == 0:
        ans *= memo[N]
        ans %= MOD
        # print(ans, N - a[M-1] - 1)
        print(ans)
    else:
        ans *= memo[N - a[M-1] - 1]
        ans %= MOD
        # print(ans, N - a[M-1] - 1)
        print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
import sys
input = sys.stdin.readline

MOD = 10 ** 9 + 7
MIN = 100


def main():
    N, M = list(map(int, input().split()))
    memo = [0] * max((N + 1), MIN)
    a = [0] * M

    memo[0] = 1
    memo[1] = 1
    memo[2] = 2
    for i in range(3, max(N+1, MIN)):
        memo[i] = memo[i-1] + memo[i-2]

    ans = 1

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

        if i != 0 and abs(a[i] - a[i-1]) == 1:
            print((0))
            return

        if a[i] == 1:
            ans *= 1
        elif i == 0:
            ans *= memo[a[i] - 1]
            ans %= MOD
            # print(a[i], ans, a[i] - 1)
        else:
            ans *= memo[a[i] - a[i-1] - 2]
            ans %= MOD
            # print(a[i], ans, a[i] - a[i-1] - 2)

    if M == 0:
        ans *= memo[N]
        ans %= MOD
        # print(ans, N - a[M-1] - 1)
        print(ans)
    else:
        ans *= memo[N - a[M-1] - 1]
        ans %= MOD
        # print(ans, N - a[M-1] - 1)
        print(ans)


if __name__ == '__main__':
    main()
# Original solution
import sys
input = sys.stdin.readline

MOD = 10 ** 9 + 7
MIN = 100


def main():
    N, M = list(map(int, input().split()))
    memo = [0] * max((N + 1), MIN)
    a = [0] * M

    memo[0] = 1
    memo[1] = 1
    memo[2] = 2
    for i in range(3, max(N+1, MIN)):
        memo[i] = memo[i-1] + memo[i-2]

    ans = 1

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

        if i != 0 and abs(a[i] - a[i-1]) == 1:
            print((0))
            return

        if a[i] == 1:
            ans *= 1
        elif i == 0:
            ans *= memo[a[i] - 1]
            ans %= MOD
            # print(a[i], ans, a[i] - 1)
        else:
            ans *= memo[a[i] - a[i-1] - 2]
            ans %= MOD
            # print(a[i], ans, a[i] - a[i-1] - 2)

    if M == 0:
        ans *= memo[N]
        ans %= MOD
        # print(ans, N - a[M-1] - 1)
        print(ans)
    else:
        ans *= memo[N - a[M-1] - 1]
        ans %= MOD
        # print(ans, N - a[M-1] - 1)
        print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
import sys
input = sys.stdin.readline

MOD = 10 ** 9 + 7
MIN = 100


def org(N, M, dp):
    a = [0] * M

    dp[0] = 1
    dp[1] = 1
    dp[2] = 2
    for i in range(3, max(N+1, MIN)):
        dp[i] = dp[i-1] + dp[i-2]

    ans = 1

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

        if i != 0 and abs(a[i] - a[i-1]) == 1:
            print((0))
            return

        if a[i] == 1:
            ans *= 1
        elif i == 0:
            ans *= dp[a[i] - 1]
            ans %= MOD
            # print(a[i], ans, a[i] - 1)
        else:
            ans *= dp[a[i] - a[i-1] - 2]
            ans %= MOD
            # print(a[i], ans, a[i] - a[i-1] - 2)

    if M == 0:
        ans *= dp[N]
        ans %= MOD
        # print(ans, N - a[M-1] - 1)
        print(ans)
    else:
        ans *= dp[N - a[M-1] - 1]
        ans %= MOD
        # print(ans, N - a[M-1] - 1)
        print(ans)


def good(N, M, dp):
    a = [0] * len(dp)

    for i in range(M):
        a[int(eval(input()))-1] = True

    dp[0] = 0 if a[0] is True else 1
    dp[1] = 0 if a[1] is True else dp[0] + 1

    if N == 1:
        print((dp[0]))
        return
    elif N == 2:
        print((dp[1]))
        return

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

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


def main():
    N, M = list(map(int, input().split()))
    dp = [0] * max((N + 1), MIN)

    good(N, M, dp)


if __name__ == '__main__':
    main()
# Original solution
import sys,math
N,M = list(map(int,input().split()))
a = [int(eval(input())) for i in range(M)]
dp = [0] * (N+1)
mod = 10**9+7
for i in range(N,-1,-1):
    if i in a:
        continue
    elif i == N or i == N-1:
        dp[i] = 1
    else:
        dp[i] = (dp[i+1] + dp[i+2])%mod
print((dp[0]))


# Optimized solution
import sys,math
N,M = list(map(int,input().split()))
a = [int(eval(input())) for i in range(M)]
b = set(a)
dp = [0] * (N+1)
mod = 10**9+7
for i in range(N,-1,-1):
    if i in b:
        continue
    elif i == N or i == N-1:
        dp[i] = 1
    else:
        dp[i] = (dp[i+1] + dp[i+2])%mod
print((dp[0]))
# Original solution
def main():
  import sys
  input = sys.stdin.readline
  n,m=list(map(int,input().split()))
  a=[int(eval(input())) for _ in [0]*m]
  mod=pow(10,9)+7
  ans=[0]*n
  ans[0]=1
  for i in range(n):
    if a.count(i+1)==1:
      ans[i]=0
    else:
      if i==1:
        ans[i]=ans[0]+1
      elif i>1:
        if ans[i-1]==0 and ans[i-2]==0:
          print((0))
          exit()
        ans[i]=(ans[i-1]%mod+ans[i-2]%mod)%mod
  print((ans[-1]))
if __name__ == '__main__':
    main()

# Optimized solution
def main():
  import sys
  input = sys.stdin.readline
  n,m=list(map(int,input().split()))
  mod=pow(10,9)+7
  ans=[1]*(n+1)
  for _ in [0]*m:
    ans[int(eval(input()))]=0
  for i in range(n+1):
    ans[i]=ans[i] if ans[i]==0 or i<2 else (ans[i-1]+ans[i-2])%mod
  print((ans[-1]))
if __name__ == '__main__':
    main()
# Original solution
maxNum, brokenCount= list(map(int, input().split()))

brokenIndexSet= set([int(eval(input())) for i in range(brokenCount)])

ans = [0]*(maxNum + 1)
ans[0] = 1

#print(ans[-1])

for i in range(1, maxNum + 1):
    if i in brokenIndexSet:
        ans[i] = 0
    else:
        ans[i] = (ans[i - 1] + ans[i - 2]) % 1000000007 

print((ans[maxNum]))


# Optimized solution
maxNum, brokenCount= list(map(int, input().split()))
brokenIndexSet= set([int(eval(input())) for i in range(brokenCount)])

ans = [0]*(maxNum+2)

ans[maxNum] = 1

for i in reversed(list(range(maxNum))):
    if i in brokenIndexSet:
        ans[i] = 0
    else:
        ans[i] = (ans[i+1] + ans[i+2]) % 1000000007 

print((ans[0]))
# Original solution
N,M=list(map(int,input().split()))
list1=[int(eval(input())) for i in range(M)]
list2=[1]
if 1 in list1:
    list2.append(0)
else:
    list2.append(1)
for i in range(N-1):
    if i+2 in list1:
        list2.append(0)
    else:
        list2.append((list2[i]+list2[i+1])%1000000007)
print((list2[N]))

# Optimized solution
N,M=list(map(int,input().split()))
list1=set([int(eval(input())) for i in range(M)])
list2=[1]+[0]*N
if not 1 in list1:
    list2[1]=1
for i in range(N-1):
    if not i+2 in list1:
        list2[i+2]=(list2[i]+list2[i+1])%1000000007
print((list2[N]))
# Original solution
N, M = list(map(int, input().split()))
a = []
stair = [1 for i in range(N+1)]
for i in range(M):
    stair[int(eval(input()))] = 0

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

dp[0] = 1

MOD = 1000000007

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

print((dp[N]))


# Optimized solution
N, M = list(map(int, input().split()))
a = []
stair = [1 for i in range(N+1)]
for i in range(M):
    stair[int(eval(input()))] = 0

dp = [0 for i in range(N+2)]

dp[1] = 1

MOD = 1000000007

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

print((dp[N+1]))
# Original solution
N, M = list(map(int, input().split()))
a = []
stair = [1 for i in range(N+1)]
for i in range(M):
    stair[int(eval(input()))] = 0

dp = [0 for i in range(N+2)]

dp[1] = 1

MOD = 1000000007

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

print((dp[N+1]))


# Optimized solution
N, M = list(map(int, input().split()))
a = []
stair = [1 for i in range(N+2)]
for i in range(M):
    stair[int(eval(input()))] = 0

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

MOD = 1000000007

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

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


# Optimized solution
n,m = list(map(int,input().split()))
lis = [int(eval(input())) for i in range(m)]
dp = [0 for i in range(n+2)]
lis.append(0)
dp[0] = 1
cou = 0
co = 0
if lis[0] == 1:co += 1
for i in range(n):
  if i+1 != lis[cou]:
    dp[i+1] += dp[i]
    dp[i+1] %= 10 ** 9+7
  else:
    cou +=1
  if i+2 != lis[co]:
    dp[i+2] += dp[i]
    dp[i+2] %= 10 ** 9 + 7
  else:
    co += 1
print((dp[n]))
# Original solution
BASE =  1000000007

class Route(object):
    def __init__(self):
        self.counter = [1]

    def getCounter(self, idx):
        if idx == -1:
            return 0
        try:
            return self.counter[idx]
        except IndexError:
            return 0

    def getList(self):
        return self.counter

    def append(self, elem):
        self.counter.append(elem)

if __name__ == '__main__':
    N, M = [int(i) for i in input().split()]
    not_available = []
    for i in range(M):
        not_available.append(int(eval(input())))
    route_counter = Route()
    for idx in range(1, N + 1):
        if idx in not_available:
            route_counter.append(0)
            continue
        route_counter.append(route_counter.getCounter(idx - 1) + route_counter.getCounter(idx - 2))
    print((route_counter.getCounter(N) % BASE))

# Optimized solution
BASE =  1000000007

if __name__ == '__main__':
    N, M = [int(i) for i in input().split()]
    not_available = []
    for i in range(M):
        not_available.append(int(eval(input())))
    x = 0
    y = 1
    predicted_next = 1
    is_available = [True] * N
    for idx in not_available:
        is_available[idx - 1] = False

    for flag in is_available:
        if flag:
            z = x + y
            x = y
            y = z
        else:
            x = y
            y = 0

    print((y % BASE))
# Original solution
n,m  = list(map(int, input().split()))
broken_stairs = []
INF = 1000000007
broken_stairs = [int(eval(input())) for i in range(m)]

dp = [0] * (n + 1)
dp[0] = 1
if 1 not in broken_stairs:
	dp[1] = 1
else:
	dp[1] = 0
for i in range(2, n + 1):
	if i in broken_stairs:
		continue
	dp[i] = dp[i - 1] + dp[i - 2]
	dp[i] %= INF
print((dp[-1]))


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

dp = [0] * (n + 1)
dp[0] = 1
if 1 not in broken_stairs:
	dp[1] = 1
else:
	dp[1] = 0
for i in range(2, n + 1):
	if i in broken_stairs:
		continue
	dp[i] = dp[i - 1] + dp[i - 2]
	dp[i] %= INF
print((dp[n]))