N, M = map(int, input().split())

stairs = []

for i in range(M):
    stairs.append(int(input()))
path = []
index = 1
if stairs[-1] == N-1:
    path.extend([1, 0])
    index += 1
else:
    path.extend([1, 1])
# caluclate from N-2 step (second last)

if N >= 2:
    for n in range(2, N):
        if N - n != stairs[-index]:
#             print(n, N - n, index, stairs[-index])
            path.append(path[n-2] + path[n-1])
        else:
            path.append(0)
            index += 1
    print((path[-1] + path[-2]) % (10**9+7)) 
#     print(path)
elif N < 2:
    print(1)
        