def fib(x):
   if x == 1:
    return 1
  a0 = 1
  a1 = 1
  for i in range(x-1):
    tmp = a1
    a1 = a0 + a1
    a0 = tmp
  return a1

n, m = map(int, input().split())
*a_list, = map(int, input().split())
a_list = a_list + [n]

count = 1
_a = 0
for a in a_list:
  num = a - _a
  count = count * fib(num) % 1000000007
  _a = a
print(count)
  