# C
# Typical Stairs

N_M = input()

N = int(N_M.split(" ")[0])
M = int(N_M.split(" ")[1])

a = []

for i in range(M):

    a.append(int(input()))

#print(a)

import numpy as np

stairs = list(np.zeros(N + 1))

if 1 in a:

    stairs[1] = 0
    stairs[2] = 1

elif 2 in a:

    stairs[1] = 1
    stairs[2] = 0

elif 1 in a and 2 in a:

    stairs[1] = 0
    stairs[2] = 0

else:

    stairs[1] = 1
    stairs[2] = 2

for i in range(N + 1):
    
    if i in a:

        stairs[i] = 0
    
    elif i > 2:

        stairs[i] = int(stairs[i - 1] + stairs[i - 2])%1000000007

    #print(stairs)

print(stairs[-1])