def fib(n):
    memo = ["EMPTY"] * (n+1)
    def _fib(n):
        if n == 0:
            return 0
        elif n == 1:
            return 1
        elif memo[n] != "EMPTY":
            return memo[n]
        else:
            memo[n] = _fib(n-1) + _fib(n-2)
            return memo[n]
    return _fib(n)

def c(n, m):
  return fib(m-n-1)
  
n,m=map(int, input().split())
a=[]
a.append(-1)
for i in range(m):
  b=int(input())
  a.append(b)
a.append(n+1)
 
ans=1

for i in range(len(a)-1):
  ans=ans*c(a[i], a[i+1])
  

print(ans%(10**9+7))