from collections import deque

def num_way(stair):
  if stair == 1 or stair == 0:
    return 1
  elif stair == 2:
    return 2
  else:
    return num_way(stair-1) + num_way(stair-2)

N, M = map(int,input().split())
a = deque([0])
path_poss = 1
ans = 1
for m in range(M):
  start = a.popleft()
  buff = int(input())
  end = buff-1
  if (end-start) <= -1:
    path_poss = 0
    break
  a.append(buff+1)
  ans *= num_way(end-start)

if path_poss == 0:
  print(0)
else:
  start = a.popleft()
  end = N
  ans *= num_way(end-start)
  print(ans%1000000007)
  