import sys
input = sys.stdin.readline
sys.setrecursionlimit(500000)
N, M = map(int, input().rstrip().split())
a = [int(input())for _ in range(M)]
dp = [-1 for _ in range(N + 1)]
if N == 1:
    print(1)
    exit()
dp[0] = 0
dp[1] = 1
def loop(n):
    if n <= 0:
        return 1
    if dp[n] >= 0:
        return dp[n]
    ans = 0
    for i in range(1, 3):
        if n - i in a:
            continue
        ans += loop(n - i)
        ans %= 1000000007

    dp[n] = ans
    return dp[n]

x = a[0]
for i in a:
    if i == x + 1:
        print(0)
        exit()

    x = i
loop(N)
print(dp[N])