from queue import Queue

length, nb_bad_steps = map(int, input().split())

bad_steps = []
for i in range(nb_bad_steps):
  bad_steps.append(int(input()))
  
ways = Queue()
nb_ways = 0
ways.put([0])
while not ways.empty():
  current_way = ways.get()  
  if current_way[-1] == length:
    nb_ways += 1
  else:
    if current_way[-1] + 1 not in bad_steps:
      new_way = current_way.copy()
      new_way.append(current_way[-1] + 1)
      ways.put(new_way)
    if current_way[-1] + 2 not in bad_steps and current_way[-1] + 2 <= length:
      new_way = current_way.copy()
      new_way.append(current_way[-1] + 2)
      ways.put(new_way)
      

print(nb_ways)