import sys
sys.setrecursionlimit(10 ** 6)

n, m = [int(i) for i in input().split()]
fibo_l = [1] + [0] * n
a = [int(input()) for i in range(m)]
for i in a:
    fibo_l[i] = None

def fibo(x):
    if x >= 0 and fibo_l[x] is not None:
        if fibo_l[x] == 0:
            fibo_l[x] = fibo(x-1) % 1000000007 + fibo(x-2) % 1000000007
        return fibo_l[x]
    else: return 0

print(fibo(n) % 1000000007)
