#!/usr/bin/env python
# coding: utf-8

# In[15]:


from collections import deque


# In[33]:


N,M = map(int, input().split())
alist = [True]*N
for _ in range(M):
    alist[int(input())-1] = False


# In[35]:


dp = deque([0]*2)
dp[0] = 1
ans = 0
mod = 1000000007
if N == 1:
    ans = 1
else:
    if 1 in alist:
        dp[1] = 0
    else:
        dp[1] = 1
    for i in range(2,N+1):
        if alist[i-1] == False:
            dp.append(0)
        else:
            dp.append((dp[0] + dp[1])%mod)
        dp.popleft()
    ans = dp[-1]
print(ans)


# In[ ]:




