import sys

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

A = int(input())
n = 1

dp = [0]*(N+1)
if N == 1:
    if 1 == A:
        print('0')
        sys.exit()
    else:
        print('1')
        sys.exit()
if 1 == A:
    dp[1] = 0
    if M != n:
        A = int(input())
        n += 1
else:
    dp[1] = 1
dp[0] = 1
for i in range(2, N+1):
    if i == A:
        dp[i] = 0
        if M != n:
            A = int(input())
            n += 1
    else:
        dp[i] = dp[i-1]%1000000007 + dp[i-2]%1000000007

print(dp[N]%1000000007)