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
for i in range(m):
    if a[i] == before:
        pass
    elif a[i] - before == 1:
        ans = 0
        break
    else:
        step = a[i] - before - 2
        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)
