var
N,MM,i,j:Longint;
m:int64=1000000007;
a:Array[1..100000]of Longint;
dp:Array[0..100002]of int64;
begin
read(N,MM);
for i:=1 to MM do read(a[i]);
dp[0]:=1;
for i:=1 to N do begin
while(j<=MM)and(a[j]<i)do inc(j);
if a[j]=i then dp[i]:=0;
dp[i]:=dp[i]mod m;
inc(dp[i+1],dp[i]);
inc(dp[i+2],dp[i]);
end;
writeln(dp[N]);
end.