n, m = (int(_) for _ in input().split())  
x = [int(input()) for i in range(m)]
xi = 0

a = [1,1]
if x[xi] == 1:
    xi += 1
    a[1] = 0

for i in range(n-1):
    if x[xi]-2 == i:
        a.append(0)
        xi = min(len(x)-1,xi+1)
    else:
        a.append(a[i+1]+a[i])

print(a[n]%1000000007)