N,M = map(int,input().split())

a = [int(input()) for i in range(M)]

wa = (10**9) + 7

def Fib(n):
    if n==0:
        return 0 #F0
    elif n==1:
        return 1 #F1
    else:
        fibo_minus1 = 1 #Fn-1
        fibo_minus2 = 0 #Fn-2
        for i in range(2,n):
            fibo = fibo_minus1 + fibo_minus2 #Fn = Fn-1 + Fn-2
            fibo_minus2 = fibo_minus1 # Fn-2の値を更新
            fibo_minus1 = fibo # Fn-1の値を更新
        return fibo





ans = 1



if M!= 1:
    length = a[0]
    ans *= Fib(length+1)

    for i in range(0,M-1):
        length = a[i+1]-a[i]-1
        # print(length)
        if length == 0:
            ans *= 0
        else:
            ans *= Fib(length+1)
        # print(ans)


    
if M==1:
    length = a[0]
    ans *= Fib(length+1)




length = N-a[-1]


ans *= Fib(length+1)

print(ans%wa)


