n, m = map(int, input().split())

list_f = []
for i in range(m):
    list_f.append(int(input()))

#0の場合はここで0を出力して終える
for i in range(m-1):
    if list_f[i+1] - list_f[i] == 1:
        print(0)
        exit()

list_score = []
for i in range(m):
    if i == 0:
        val = list_f[i]
    else:
        val = list_f[i] - list_f[i-1] - 1
    list_score.append(val)

list_score.append(n - list_f[-1])

# print(list_score)

from functools import lru_cache
@lru_cache(maxsize=1000)
def test(n):
    if n == 1:
        return 1

    if n == 2:
        return 1
        
    return((test(n - 1)%1000000007 + test(n - 2)%1000000007))

score = 1
for i in list_score:
    score = score * test(i)

print(score%1000000007)