N, M = map(int, input().split())
MOD = 10**9 + 7
if M == 0:
    print(pat[N] % MOD)
else:
    A = [int(input()) for _ in range(M)]
    pat = [0] * (N+1)
    pat[1] = 1
    pat[2] = 2
    for i in range(3, N+1):
        pat[i] = (pat[i-1] + pat[i-2]) % MOD
    steps = []
    for i in range(M-1):
        d = A[i+1] - A[i]
        if d  > 2:
            steps.append(d)
        elif d == 1:
            steps.append(0)
    if A[0] != 1:
        steps = [A[0] - 1] + steps
    if A[-1] != N-1:
        steps += [N - A[-1] - 1]
    ans = 1
    for s in steps:
        ans = (ans * pat[s]) % MOD
    print(ans)