def cul_num(key):
    if key == 0:
        return 0
    if key <= 2:
        return 1
    if key == 3:
        return 2
    return cul_num(key-1)+cul_num(key-2)+1

n, m = map(int, input().split())
a = []
res = 1

[a.append(int(input())) for _ in range(m)]
a.append(n+1)

for index,i in enumerate(a):
    if i == a[0]:
        res *= cul_num(i)
    else:
        res *= cul_num(i-a[index-1]-1)
    if res > 1000000007:
        res = res % 1000000007

print(res)
