N, M = map(int, input().split())
a_n = [int(input()) for i in range(M)]

def Fib(n):    
    if n == 1:
        return 0
    elif n == 2:
        return 1
    else:
        return Fib(n-1)+Fib(n-2)
      
now = 0
before = -9999
answer = 1

for a in a_n:
    if a - before == 1:
        answer = 0
        break    
    answer *= Fib( a - 1 - now + 2 )
    now = a + 1
    before = a

if answer > 0:
    answer *= Fib( N - now + 2)

print(answer % 1000000007)