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


def fib(n):
    if n <= 4:
        return n
    else:
        first = 3
        second = 4
        for _i in range(n-4):
            third = second+first-1
            first = second
            second = third
        return second


a = [0]
for i in range(M):
    a.append(int(input()))
a.append(N)

possibilities = 1
for i in range(len(a)-1):
    if a[i+1] == 1:
        continue
    dif = a[i+1]-a[i]-1
    if dif == 0:
        possibilities *= 0
        break
    else:
        possibilities *= fib(dif)
print(possibilities%1000000007)
