import sys



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

A = set()

for _ in range(M):

    A.add(int(sys.stdin.readline()))



# i段目の階段への到達方法の数

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

dp[0] = 1

dp[1] = 0 if 1 in A else 1



for i in range(2, N+1):

    if i in A:

        continue

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

    dp[i] %= 1000000007



print((dp[N]))
import sys



mod = 1000000007



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

A = set()

for _ in range(M):

    a = int(sys.stdin.readline())

    A.add(a)



dp = [0] * (N+1)

dp[0] = 1

dp[1] = 0 if 1 in A else 1

for i in range(1, N):

    if i+1 in A:

        continue

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

    dp[i+1] %= mod



# print(dp)

print((dp[N]))
import sys

N, M = list(map(int, sys.stdin.readline().strip().split()))
A = set()
for _ in range(M):
    A.add(int(sys.stdin.readline()))
# i段目の階段への到達方法の数
dp = [0 for _ in range(N + 1)]
dp[0] = 1
dp[1] = 0 if 1 in A else 1
for i in range(2, N + 1):
    if i in A:
        continue
    dp[i] = dp[i - 1] + dp[i - 2]
    dp[i] %= 1000000007
print((dp[N]))

import sys

mod = 1000000007
N, M = list(map(int, sys.stdin.readline().split()))
A = set()
for _ in range(M):
    a = int(sys.stdin.readline())
    A.add(a)
dp = [0] * (N + 1)
dp[0] = 1
dp[1] = 0 if 1 in A else 1
for i in range(1, N):
    if i + 1 in A:
        continue
    dp[i + 1] = dp[i] + dp[i - 1]
    dp[i + 1] %= mod
# print(dp)
print((dp[N]))

-N, M = list(map(int, sys.stdin.readline().strip().split())) +mod = 1000000007 +N, M = list(map(int, sys.stdin.readline().split())) -    A.add(int(sys.stdin.readline())) -# i段目の階段への到達方法の数 -dp = [0 for _ in range(N + 1)] +    a = int(sys.stdin.readline()) +    A.add(a) +dp = [0] * (N + 1) -for i in range(2, N + 1): -    if i in A: +for i in range(1, N): +    if i + 1 in A: -    dp[i] = dp[i - 1] + dp[i - 2] -    dp[i] %= 1000000007 +    dp[i + 1] = dp[i] + dp[i - 1] +    dp[i + 1] %= mod +# print(dp)