    import sys
    import numpy as np
     
    X = (1+np.sqrt(5))/2
    Y = (1-np.sqrt(5))/2
    Z = np.sqrt(5)
     
    def InputToInt():
        A = input().split()
        for i in range(len(A)):
            A[i] = int(A[i])
        return A
     
    def cases(N):
        if N == 0:
            print('0')
            sys.exit()
        return int((np.power(X, N)-np.power(Y, N))/Z+0.1)
        
        
    if __name__ == '__main__':
        N, M = InputToInt()
        result = 1
        oldA = -1
        for i in range(M):
            A = int(input())
            result *= cases(A - oldA - 1)
            oldA = A
        result *= cases(N - A)
        print(result % 1000000007)