def fib(n):
    '''f(n)=f(n-1)+f(n-2)'''
    a, b = 0, 1
    for _ in range(n-1):
        a, b = b, a+b
    return b


n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]
ans = fib(a[0])*fib(n-a[m-1])
for i in range(m-1):
    if a[i+1]-a[i] == 1:
        ans = 0
        break
    ans = ans * fib(a[i+1]-a[i]-1) % (10**9+7)

print(ans)
