import numpy as np

N, M = map(int, input().split())
A = np.array([int(input()) for _ in range(M)])
q = 1000000007

if N == 1:
    if M == 0:
        print(1)
    elif M == 1:
        print(0)
    else:
        cost = np.zeros(N + 1, dtype=np.int64)
        cost[0] = 1
        cost[1] = 1
        cost[A] = 0
        cost[2] = cost[0] + cost[1]

        for i in range(1, N + 1):
            cost[A] = 0
            cost[i] = (cost[i - 1] + cost[i - 2]) % q

        print(cost[-1] % q)
