#!venv/bin/python
 
import math
import numpy as np
import random
import copy
import statistics 
import bisect
import heapq
from collections import defaultdict 
import time
import sys

WARU = 1000000007

N, M = [ int(x) for x in input().split() ]
A = {}
for i in range(M):
    A[int(input())] = 1

ans = [None for i in range(N + 1)]
ans[0] = 1
ans[1] = 1 if not 1 in A else 0

def steps(n):
    if ans[n] is not None:
        return ans[n]
    if n in A:
        return 0
    #print ("{} : {}".format(n, steps(n - 1) + steps(n - 2)))
    ans[n] = (steps(n - 1) + steps(n - 2)) % WARU
    return ans[n]

#print(ans)
print(steps(N))
