import java.util.*;
import java.io.*;

public class Main
{
	public static void main(String [] Args)
	{
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		int m=in.nextInt();
		long [] vis=new long [n+1];
		vis[0]=1;
		for(int i=0;i<m;i++)
		{
			int k=in.nextInt();
			vis[k]=-1;
		}
		if(vis[1]!=-1)
			vis[1]=1;
		for(int i=2;i<=n;i++)
		{
			if(vis[i]!=-1)
			{
				if(vis[i-1]==-1)
					vis[i]=vis[i-2];
				else if(vis[i-2]==-1)
					vis[i]=vis[i-1];
				else
				    vis[i]=(vis[i-1]+vis[i-2])%1000000007;
			}
		}
		if(vis[n]==-1)
			vis[n]=0;
		System.out.println(vis[n]);
	}
}
	
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz