def up_stairs(At, now):
  
  if now == At:
    return 1
  if now > At:
    return 0

  return up_stairs(At, now + 1) + up_stairs(At, now + 2)


N,M = (int(x) for x in input().split())

now_step = 0
ans = 1
for i in range(M):
  A = int(input())
  ans *= up_stairs(A - 1, now_step)
  now_step = A + 1

ans *= up_stairs(N, now_step)
print(int(ans % 1000000007))