N, M = map(int, input().split())
A = []
import sys
flg = 0
for i in range(M):
    a = int(input())
    if a == 1 or a == 2:
        flg = a
    if i != 0:
        if a == A[-1] + 1:
            flg = 3
    A.append(a)
if flg == 3:
    print(0)
    sys.exit()
ary = list(range(3, N + 1))
for a in A:
    try:
        ary.remove(a)
    except:
        pass
def step(n):
    steps = [0 for i in range(n + 1)]
    if flg == 0:
        steps[1] = 1
        steps[2] = 2
    elif flg == 1:
        steps[2] = 1
    else:
        steps[1] = 1
    for i in ary:
        steps[i] = steps[i - 1] + steps[i - 2]
    return steps[n] % 1000000007
print(step(N))