import numpy as np


def chmin(a1, a2):
    if a1 <= a2:
        return a1
    elif a1 > a2:
        return a2


n, m = map(int, input().split())
a = np.zeros(m)
for i in range(m):
    a[i] = int(input())

dp = np.full(n + 1, np.inf)
dp[0] = 1
dp[1] = 1

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

print(int(dp[n]))

"""
100 5
1
23
45
67
89
"""
