import sys

[N, M] = [int(i) for i in input().split()]

steps = [0, 1, 2]
for i in range(3, N+1):
    steps.append(steps[i-1] + steps[i-2])
  
if M == 0:
    print(steps[N])
    print(steps)
    sys.exit()
    
As = []
for i in range(M):
    As.append(int(input()))
    
deffs = []

if As[0] != 1:
    deffs.append(As[0] - 1)
else:
    deffs.append(1)

for i in range(1, M):
    d = As[i] - As[i-1] -2
    if d == 0:
        deffs.append(1)
    elif d == -1:
        deffs.append(0)
    else:
        deffs.append(d)

if N - As[M-1] - 1 != 0:
    deffs.append(N - As[M-1] - 1)
else:
    deffs.append(1)

ans = 1

for i in range(len(deffs)):
    ans *= steps[deffs[i]]
    
print(ans % 1000000007)
