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

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

wa = (10**9) + 7

import sympy as sym #sympyのインポート
def Fib(n):
    x = sym.symbols('x',nonnegative=True,integer=True) #変数xの宣言(非負の整数)
    Fib=1/sym.sqrt(5)*(((1+sym.sqrt(5))/2)**(n-1)-((1-sym.sqrt(5))/2)**(n-1)) #一般項の式
    result=Fib.subs(x,n) #xにnを代入
    result=result.evalf() #式を浮動小数点数として評価
    return int(result)





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
        ans *= Fib(length+1)


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

# print(ans)

length = N-a[-1]
# print(length)

ans *= Fib(length+1)

print(ans%wa)

