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)
def main():
    sum = 1
    b = -1
    N,M = map(int,input().split())
    for i in range(M):
        a = int(input())
        if a == b+1:
            print(0)
            exit()
        sum *= Fib(a-b)
        b = a 
    sum *= Fib(N-b)
    
    print(sum%1000000007)
#if __name__ == '__main__':
main()
