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

stairs = []

for i in range(M):
    stairs.append(int(input()))
path = []
path.extend([1, 2])
# caluclate from last step
for n in range(3, N):
    if N - n not in stairs:
        path.append(path[n-3] + path[n-2])
    else:
        path.append(0)
        
print((path[-1] + path[-2]) % (10**9+7)) 