import sys
sys.setrecursionlimit(10000)
n,m = map(int,input().split())
a = [int(input()) for i in range(m)]
def toori(n):
    if n == 1:
        return 1
    elif n ==2:
        return 2
    else:
        return toori(n-1) + toori(n-2)
    
res =toori(a[0]-1)

for i in range(m):
    p= a[i+1] - a[i]-1
    res = res * toori(p)
print(res%1000000007)