n, m = map(int, input().split())
t_list = []
for _ in range(m):
  t = int(input())
  t_list.append(t)
i = 0
ans = 1
while i < n:
  if i+1 in t_list:
    ans = ans * 1
    i += 1
    if i+1 in t_list:
      ans = 0
      break
  else:
    if i+2 in t_list and not i+3 in t_list:
      ans = ans * 1
      i += 2
    elif i+1 == n:
      ans = ans * 1
    else:
      ans = ans * 2
  i += 1
    
print(ans % 1000000007)