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

a = set([int(eval(input())) for _ 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]))
import sys

import math

from fractions import gcd

# import queue

# from collections import Counter

# from itertools import accumulate

# from functools import reduce



def lcm(a, b):

    return a * b // gcd(a, b)



def combination_count(n, r):

    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))



def permutations_count(n, r):

    return math.factorial(n) // math.factorial(n - r)



big_prime = 1000000007



"""

# 標準入力取得

## 文字列

 =  sys.stdin.readline().rstrip()

 =  list(sys.stdin.readline().rstrip())



## 数値

 =  int(sys.stdin.readline())

 =  map(int, sys.stdin.readline().split())

 =  list(map(int, sys.stdin.readline().split()))

 = list(map(int,sys.stdin.readlines())) #縦入力

 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]

"""

n,m =  list(map(int, sys.stdin.readline().split()))



dp=[0]*(n+1)

list_a = set(map(int,sys.stdin.readlines()))



dp[0]=1



for i in range(1,n+1):

    dp[i] = (dp[i-1] + dp[i-2]) % big_prime #dp[-1]=0

    if i in list_a:

        dp[i]=0

ans = dp[n]

print(ans)

N, M = list(map(int, input().split()))
a = set([int(eval(input())) for _ 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]))

import sys
import math
from fractions import gcd

# import queue
# from collections import Counter
# from itertools import accumulate
# from functools import reduce
def lcm(a, b):
    return a * b // gcd(a, b)


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


def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)


big_prime = 1000000007
"""
# 標準入力取得
## 文字列
 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())
## 数値
 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 = list(map(int,sys.stdin.readlines())) #縦入力
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""
n, m = list(map(int, sys.stdin.readline().split()))
dp = [0] * (n + 1)
list_a = set(map(int, sys.stdin.readlines()))
dp[0] = 1
for i in range(1, n + 1):
    dp[i] = (dp[i - 1] + dp[i - 2]) % big_prime  # dp[-1]=0
    if i in list_a:
        dp[i] = 0
ans = dp[n]
print(ans)

-N, M = list(map(int, input().split())) -a = set([int(eval(input())) for _ in range(M)]) -INF = 1000000007 -dp = [0] * (N + 1) +import sys +import math +from fractions import gcd + +# import queue +# from collections import Counter +# from itertools import accumulate +# from functools import reduce +def lcm(a, b): +    return a * b // gcd(a, b) + + +def combination_count(n, r): +    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) + + +def permutations_count(n, r): +    return math.factorial(n) // math.factorial(n - r) + + +big_prime = 1000000007 +""" +# 標準入力取得 +## 文字列 + =  sys.stdin.readline().rstrip() + =  list(sys.stdin.readline().rstrip()) +## 数値 + =  int(sys.stdin.readline()) + =  map(int, sys.stdin.readline().split()) + =  list(map(int, sys.stdin.readline().split())) + = list(map(int,sys.stdin.readlines())) #縦入力 + =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)] +""" +n, m = list(map(int, sys.stdin.readline().split())) +dp = [0] * (n + 1) +list_a = set(map(int, sys.stdin.readlines())) -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])) +for i in range(1, n + 1): +    dp[i] = (dp[i - 1] + dp[i - 2]) % big_prime  # dp[-1]=0 +    if i in list_a: +        dp[i] = 0 +ans = dp[n] +print(ans)