N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]

if M == 0:
    maxM = N
else:
    maxM = a[0] - 1
    for i in range(1, M):
        maxM = max(maxM, a[i] - a[i-1] - 2)
    maxM = max(maxM, N - a[-1])

dp = [0] * (maxM+1)
dp[1] = 1
if maxM > 1:
    dp[2] = 2
    if maxM > 2:
        for n in range(3, maxM+1):
            dp[n] = dp[n-1] + dp[n - 2] % 1000000007

if M == 0:
    print(dp[-1])
    exit()

if a[0] == 1:
    ans = 1
else:
    ans = dp[a[0] - 1]

if M > 1:
    for i in range(1, M):
        if a[i] - a[i - 1] <= 1:
            ans = 0
        else:
            ans = ans * dp[a[i] - a[i - 1] - 2] % 1000000007
if N - a[-1] != 1:
    ans = ans * dp[N - a[-1] - 1] % 1000000007
print(ans)
