def fib(n):
    a, b = 1, 1
    for _ in range(n):
        a, b = b, a + b
    return a


n, m = map(int, input().split())
a = [-1] + [int(input()) for i in range(m)] + [n + 1]
ans = 1

for i in range(len(a) - 1):
    if a[i] != 0 and a[i + 1] != n and a[i + 1] - a[i] == 1:
        print(0)
        exit()
    print(fib(a[i + 1] - a[i] - 2))
    ans = ans * fib(a[i + 1] - a[i] - 2) % (10 ** 9 + 7)

print(ans)
