import sys
input = sys.stdin.readline

N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
         
n = [1, 1]
cnt = 2
while cnt!=N+1:
    if cnt-1 in a:n[1]=0
    n[0], n[1] = n[1], n[0]+n[1] 
    cnt += 1
    if n[1]==0:break

print(n[-1]%(10**9+7))