import sys

N, M = list(map(int, input().split()))
A = set()

sys.setrecursionlimit(N * 2)

Z = 1000000007

for _ in range(M):
    a = int(input())
    A.add(a)


B = [-1] * (N + 1)


def d(n):
    if B[n] != -1:
        return B[n]

    if n in A or n < 0:
        return 0
    if n <= 2:
        return n

    B[n] = (d(n-1) + d(n-2)) % Z
    return B[n]


print(d(N))
