n,m=map(int,input().split())
b=[int(input()) for _ in range(m)]
a=[0]*n
if 1 not in b:
  a[0]=1
if 2 not in b:
  a[1]=2
for i in range(2,n):
  if i+1 not in b:
    a[i]=a[i-1]+a[i-2]
print(a)
print(a[-1]%(10**9+7))