Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# coding: utf-8

# In[31]:


N, M = map(int, input().split())
As = [int(input()) for i in range(M)]
"""
100 5
1
23
45
67
89
"""


# In[32]:


import numpy as np


# In[33]:


As = np.array(As)
oAs = As[1:]-As[:-1]
if 1 in oAs:
    print(0)
    sys.exit()


# In[34]:


stairs = [0]*(N+3)
stairs[0] = 1
#stairs[1] = 1

start_stage = 0
for i in range(M):
    collapsed_stage = As[i]
    finish_stage = collapsed_stage - 1
    #print(start_stage, finish_stage)
    continuous_stairs = finish_stage - start_stage
    if continuous_stairs < 2:
        stairs[finish_stage+2] = stairs[start_stage]
        start_stage = finish_stage+2
    else:
        stairs[start_stage+1] = stairs[start_stage]
        for i in range(continuous_stairs-1):
            stairs[start_stage+i+2] = stairs[start_stage+i] + stairs[start_stage+i+1]
        stairs[finish_stage+2] = stairs[finish_stage]
        start_stage = finish_stage+2

if N-start_stage < 2:
    stairs[N] = stairs[start_stage]
else:
    continuous_stairs = N - start_stage
    stairs[start_stage+1] = stairs[start_stage]
    for i in range(continuous_stairs-1):
        stairs[start_stage+i+2] = stairs[start_stage+i] + stairs[start_stage+i+1]
        #print(stairs)
        
#print(list(range(N+1)))
#print(stairs)
print(stairs[N]%1000000007)


# In[ ]:






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

# In[31]:


N, M = map(int, input().split())
As = [int(input()) for i in range(M)]
"""
100 5
1
23
45
67
89
"""


# In[32]:


import numpy as np
import sys


# In[33]:


As = np.array(As)
oAs = As[1:]-As[:-1]
if 1 in oAs:
    print(0)
    sys.exit()


# In[34]:


stairs = [0]*(N+3)
stairs[0] = 1
#stairs[1] = 1

start_stage = 0
for i in range(M):
    collapsed_stage = As[i]
    finish_stage = collapsed_stage - 1
    #print(start_stage, finish_stage)
    continuous_stairs = finish_stage - start_stage
    if continuous_stairs < 2:
        stairs[finish_stage+2] = stairs[start_stage]
        start_stage = finish_stage+2
    else:
        stairs[start_stage+1] = stairs[start_stage]
        for i in range(continuous_stairs-1):
            stairs[start_stage+i+2] = stairs[start_stage+i] + stairs[start_stage+i+1]
        stairs[finish_stage+2] = stairs[finish_stage]
        start_stage = finish_stage+2

if N-start_stage < 2:
    stairs[N] = stairs[start_stage]
else:
    continuous_stairs = N - start_stage
    stairs[start_stage+1] = stairs[start_stage]
    for i in range(continuous_stairs-1):
        stairs[start_stage+i+2] = stairs[start_stage+i] + stairs[start_stage+i+1]
        #print(stairs)
        
#print(list(range(N+1)))
#print(stairs)
print(stairs[N]%1000000007)


# In[ ]:

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python
# coding: utf-8

# In[2]:


N, M = map(int, input().split())
As = [int(input()) for i in range(M)]
"""
100 5
1
23
45
67
89
"""


# In[6]:


stairs = [0]*(N+1)
stairs[0] = 1
for i in range(N):
    #if i == N-1:
    #    break
    if i <= N-1:
        if i+1 not in As:
            stairs[i+1] += stairs[i]
    if i <= N-2:
        if i+2 not in As:
            stairs[i+2] += stairs[i]
    
print(stairs[N]%1000000007)


# In[ ]:






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

# In[31]:


N, M = map(int, input().split())
As = [int(input()) for i in range(M)]
"""
100 5
1
23
45
67
89
"""


# In[32]:


import numpy as np
import sys


# In[33]:


As = np.array(As)
oAs = As[1:]-As[:-1]
if 1 in oAs:
    print(0)
    sys.exit()


# In[34]:


stairs = [0]*(N+3)
stairs[0] = 1
#stairs[1] = 1

start_stage = 0
for i in range(M):
    collapsed_stage = As[i]
    finish_stage = collapsed_stage - 1
    #print(start_stage, finish_stage)
    continuous_stairs = finish_stage - start_stage
    if continuous_stairs < 2:
        stairs[finish_stage+2] = stairs[start_stage]
        start_stage = finish_stage+2
    else:
        stairs[start_stage+1] = stairs[start_stage]
        for i in range(continuous_stairs-1):
            stairs[start_stage+i+2] = stairs[start_stage+i] + stairs[start_stage+i+1]
        stairs[finish_stage+2] = stairs[finish_stage]
        start_stage = finish_stage+2

if N-start_stage < 2:
    stairs[N] = stairs[start_stage]
else:
    continuous_stairs = N - start_stage
    stairs[start_stage+1] = stairs[start_stage]
    for i in range(continuous_stairs-1):
        stairs[start_stage+i+2] = stairs[start_stage+i] + stairs[start_stage+i+1]
        #print(stairs)
        
#print(list(range(N+1)))
#print(stairs)
print(stairs[N]%1000000007)


# In[ ]: