n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]

tmp = [1, 2]
for i in range(10 ** 5):
    tmp.append(tmp[-1] + tmp[-2])

ans = 1
before = -1
if m != 0:
    for i in range(m):
        step = a[i] - before - 2
        if step == -1:
            ans = 0
            break
        elif step > 0:
            ans = ans * tmp[step-1]
            ans = ans % 1000000007

        before = a[i]

# final steps
step = n - before - 1
if step == 0:
    ans = 0
elif step > 0:
    ans *= tmp[step-1]
    ans = ans % 1000000007

print(ans)
