n,m = map(int,input().split())
A = [int(input()) for i in range(m)]

def stair(x):
    if x == 0:
        return 0
    elif x == 1:
        return 1
    else:
        return stair(x - 1) + stair(x - 2)

s = stair(A[0]) * stair(n - A[m - 1])

for i in range(m - 1):
    a = A[i + 1] - A[i] - 1
    s = s * stair(a)



print(int(s%1000000007))
