n, m = map(int, input().split())
S = []
tmp = int(input())
s = tmp + 1
for _ in range(m-1):
  a = int(input())
  S.append(a-tmp)
  tmp = a
g = n-tmp+1

fib = [1 for _ in range(n+1)]
for i in range(2, n-1):
  fib[i+2] = fib[i] + fib[i+1]
total = fib[s]*fib[g]

fib[1] = 0

for x in S:
  total *= fib[x]
  
print(s, S, g)
print(total%1000000007)