#ABC129C-TypicalStairs.py

#import list
from sys import stdin

input = stdin.readline

#constant
#N = int(input())
N, M = list(map(int,input().split()))
A = [int(input()) for _ in range(M)]+[N+1]

#variable

#function
def partition(two_steps,total_steps):
    if two_steps == 0:
        return 1
    elif two_steps == 1:
        return total_steps-1
    else:
        result = 0
        for i in range(total_steps-(2*(two_steps-1))):
            result += partition(two_steps-1,total_steps-(i+2))
        return result

def sectorSum(total_steps):
    if total_steps == 0:
        return 0
    result = 0
    max_two_steps = total_steps//2
    for two_steps in range(max_two_steps+1):
        result += partition(two_steps,total_steps)
    return result
#class

#main function
def main():
    totalResult = 1
    position = 0
    i = 0
    while position < N:
        a = A.pop(0)
        if position+1 == a:
            position = a+1
            if position == A[0]:
                totalResult = 0
                break
        else:
            totalResult = totalResult*sectorSum(a-1-position)
            print(a-1-position)
            position = a+1
    print(totalResult%1000000007)




if __name__ == "__main__":
    main()
