import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		long mod=1000000007;
		int[] a =new int[m];
		long[] dp=new long[n+1];
		dp[0]=1;
		for(int i=0; i<m; i++){
			a[i] = sc.nextInt();
			if(i!=0 && a[i]==a[i-1]+1){
				System.out.println(0);
				return;
			}
		}
		int count=0;
		boolean kk=false;
		for(int i=1; i<n+1; i++){
			if(m!=0 && !kk && i==a[count] && i!=n){
				count++;
				if(count>m-1){
					count=0;
					kk=true;
				}
				dp[i+1]=dp[i-1];
			}else{
				if(i==1){
					dp[i]+=dp[i-1];
					dp[i]%=mod;
					continue;
				}
				if(dp[i]==0){
					dp[i]+=dp[i-1]+dp[i-2];
					dp[i]%=mod;
				}
			}
		}
		System.out.println(dp[n]);
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		long mod=1000000007;
		int[] a =new int[m];
		long[] dp=new long[n+1];
		dp[0]=1;
		for(int i=0; i<m; i++){
			a[i] = sc.nextInt();
			if(i!=0 && a[i]==a[i-1]+1){
				System.out.println(0);
				return;
			}
		}
		int count=0;
		boolean kk=false;
		for(int i=1; i<n+1; i++){
			if(m!=0 && !kk && i==a[count] && i!=n){
				count++;
				if(count>m-1){
					count=0;
					kk=true;
				}
				dp[i+1]=dp[i-1];
			}else{
				if(i==1){
					dp[i]+=dp[i-1];
					dp[i]%=mod;
					continue;
				}
				if(dp[i]==0){
					dp[i]+=dp[i-1]+dp[i-2];
					dp[i]%=mod;
				}
			}
		}
		System.out.println(dp[n]);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		long mod=1000000007;
		int[] a =new int[m];
		long[] dp=new long[n+1];
		dp[0]=1;
		for(int i=0; i<m; i++){
			a[i] = sc.nextInt();
			if(i!=0 && a[i]==a[i-1]+1){
				System.out.println(0);
				return;
			}
		}
		int count=0;
		boolean kk=false;
		for(int i=1; i<n+1; i++){
			if(m!=0 && !kk && i==a[count] && i!=n){
				count++;
				if(count>m-1){
					count=0;
					kk=true;
				}
				dp[i+1]=dp[i-1];
			}else{
				if(i==1){
					dp[i]+=dp[i-1];
					dp[i]%=mod;
					continue;
				}
				if(dp[i]==0){
					dp[i]+=dp[i-1]+dp[i-2];
					dp[i]%=mod;
				}
			}
		}
		System.out.println(dp[n]);
	} main {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		long mod=1000000007;
		int[] a =new int[m];
		long[] dp=new long[n+1];
		dp[0]=1;
		for(int i=0; i<m; i++){
			a[i] = sc.nextInt();
			if(i!=0 && a[i]==a[i-1]+1){
				System.out.println(0);
				return;
			}
		}
		int count=0;
		boolean kk=false;
		for(int i=1; i<n+1; i++){
			if(m!=0 && !kk && i==a[count] && i!=n){
				count++;
				if(count>m-1){
					count=0;
					kk=true;
				}
				dp[i+1]=dp[i-1];
			}else{
				if(i==1){
					dp[i]+=dp[i-1];
					dp[i]%=mod;
					continue;
				}
				if(dp[i]==0){
					dp[i]+=dp[i-1]+dp[i-2];
					dp[i]%=mod;
				}
			}
		}
		System.out.println(dp[n]);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int m=sc.nextInt(); m sc.nextInt() sc.nextInt sc long mod=1000000007; mod 1000000007 int[] a =new int[m]; a new int[m] m long[] dp=new long[n+1]; dp new long[n+1] n+1 n 1 dp[0]=1 dp[0] dp 0 1 for(int i=0; i<m; i++){
			a[i] = sc.nextInt();
			if(i!=0 && a[i]==a[i-1]+1){
				System.out.println(0);
				return;
			}
		} int i=0; int i=0; i 0 i<m i m i++ i++ i {
			a[i] = sc.nextInt();
			if(i!=0 && a[i]==a[i-1]+1){
				System.out.println(0);
				return;
			}
		} {
			a[i] = sc.nextInt();
			if(i!=0 && a[i]==a[i-1]+1){
				System.out.println(0);
				return;
			}
		} a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc if(i!=0 && a[i]==a[i-1]+1){
				System.out.println(0);
				return;
			} i!=0 && a[i]==a[i-1]+1 i!=0 i 0 a[i]==a[i-1]+1 a[i] a i a[i-1]+1 a[i-1] a i-1 i 1 1 {
				System.out.println(0);
				return;
			} System.out.println(0) System.out.println System.out System System.out 0 return; int count=0; count 0 boolean kk=false; kk false for(int i=1; i<n+1; i++){
			if(m!=0 && !kk && i==a[count] && i!=n){
				count++;
				if(count>m-1){
					count=0;
					kk=true;
				}
				dp[i+1]=dp[i-1];
			}else{
				if(i==1){
					dp[i]+=dp[i-1];
					dp[i]%=mod;
					continue;
				}
				if(dp[i]==0){
					dp[i]+=dp[i-1]+dp[i-2];
					dp[i]%=mod;
				}
			}
		} int i=1; int i=1; i 1 i<n+1 i n+1 n 1 i++ i++ i {
			if(m!=0 && !kk && i==a[count] && i!=n){
				count++;
				if(count>m-1){
					count=0;
					kk=true;
				}
				dp[i+1]=dp[i-1];
			}else{
				if(i==1){
					dp[i]+=dp[i-1];
					dp[i]%=mod;
					continue;
				}
				if(dp[i]==0){
					dp[i]+=dp[i-1]+dp[i-2];
					dp[i]%=mod;
				}
			}
		} {
			if(m!=0 && !kk && i==a[count] && i!=n){
				count++;
				if(count>m-1){
					count=0;
					kk=true;
				}
				dp[i+1]=dp[i-1];
			}else{
				if(i==1){
					dp[i]+=dp[i-1];
					dp[i]%=mod;
					continue;
				}
				if(dp[i]==0){
					dp[i]+=dp[i-1]+dp[i-2];
					dp[i]%=mod;
				}
			}
		} if(m!=0 && !kk && i==a[count] && i!=n){
				count++;
				if(count>m-1){
					count=0;
					kk=true;
				}
				dp[i+1]=dp[i-1];
			}else{
				if(i==1){
					dp[i]+=dp[i-1];
					dp[i]%=mod;
					continue;
				}
				if(dp[i]==0){
					dp[i]+=dp[i-1]+dp[i-2];
					dp[i]%=mod;
				}
			} m!=0 && !kk && i==a[count] && i!=n i==a[count] m!=0 && !kk && i==a[count] && i!=n m!=0 m 0 !kk kk i==a[count] i a[count] a count i!=n i n {
				count++;
				if(count>m-1){
					count=0;
					kk=true;
				}
				dp[i+1]=dp[i-1];
			} count++ count if(count>m-1){
					count=0;
					kk=true;
				} count>m-1 count m-1 m 1 {
					count=0;
					kk=true;
				} count=0 count 0 kk=true kk true dp[i+1]=dp[i-1] dp[i+1] dp i+1 i 1 dp[i-1] dp i-1 i 1 {
				if(i==1){
					dp[i]+=dp[i-1];
					dp[i]%=mod;
					continue;
				}
				if(dp[i]==0){
					dp[i]+=dp[i-1]+dp[i-2];
					dp[i]%=mod;
				}
			} if(i==1){
					dp[i]+=dp[i-1];
					dp[i]%=mod;
					continue;
				} i==1 i 1 {
					dp[i]+=dp[i-1];
					dp[i]%=mod;
					continue;
				} dp[i]+=dp[i-1] dp[i] dp i dp[i-1] dp i-1 i 1 dp[i]%=mod dp[i] dp i mod continue; if(dp[i]==0){
					dp[i]+=dp[i-1]+dp[i-2];
					dp[i]%=mod;
				} dp[i]==0 dp[i] dp i 0 {
					dp[i]+=dp[i-1]+dp[i-2];
					dp[i]%=mod;
				} dp[i]+=dp[i-1]+dp[i-2] dp[i] dp i dp[i-1]+dp[i-2] dp[i-1] dp i-1 i 1 dp[i-2] dp i-2 i 2 dp[i]%=mod dp[i] dp i mod System.out.println(dp[n]) System.out.println System.out System System.out dp[n] dp n String[] args args public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		long mod=1000000007;
		int[] a =new int[m];
		long[] dp=new long[n+1];
		dp[0]=1;
		for(int i=0; i<m; i++){
			a[i] = sc.nextInt();
			if(i!=0 && a[i]==a[i-1]+1){
				System.out.println(0);
				return;
			}
		}
		int count=0;
		boolean kk=false;
		for(int i=1; i<n+1; i++){
			if(m!=0 && !kk && i==a[count] && i!=n){
				count++;
				if(count>m-1){
					count=0;
					kk=true;
				}
				dp[i+1]=dp[i-1];
			}else{
				if(i==1){
					dp[i]+=dp[i-1];
					dp[i]%=mod;
					continue;
				}
				if(dp[i]==0){
					dp[i]+=dp[i-1]+dp[i-2];
					dp[i]%=mod;
				}
			}
		}
		System.out.println(dp[n]);
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		long mod=1000000007;
		int[] a =new int[m];
		long[] dp=new long[n+1];
		dp[0]=1;
		for(int i=0; i<m; i++){
			a[i] = sc.nextInt();
			if(i!=0 && a[i]==a[i-1]+1){
				System.out.println(0);
				return;
			}
		}
		int count=0;
		boolean kk=false;
		for(int i=1; i<n+1; i++){
			if(m!=0 && !kk && i==a[count] && i!=n){
				count++;
				if(count>m-1){
					count=0;
					kk=true;
				}
				dp[i+1]=dp[i-1];
			}else{
				if(i==1){
					dp[i]+=dp[i-1];
					dp[i]%=mod;
					continue;
				}
				if(dp[i]==0){
					dp[i]+=dp[i-1]+dp[i-2];
					dp[i]%=mod;
				}
			}
		}
		System.out.println(dp[n]);
	}
} Main
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		long mod=1000000007;
		int[] a =new int[m];
		long[] dp=new long[n+1];
		dp[0]=1;
		for(int i=0; i<m; i++){
			a[i] = sc.nextInt();
			if(i!=0 && a[i]==a[i-1]+1){
				System.out.println(0);
				return;
			}
		}
		int count=0;
		boolean kk=false;
		for(int i=1; i<n+1; i++){
			if(m!=0 && !kk && i==a[count] && i!=n){
				count++;
				if(count>m-1){
					count=0;
					kk=true;
				}
				dp[i+1]=dp[i-1];
			}else{
				if(i==1){
					dp[i]+=dp[i-1];
					dp[i]%=mod;
					continue;
				}
				if(dp[i]==0){
					dp[i]+=dp[i-1]+dp[i-2];
					dp[i]%=mod;
				}
			}
		}
		System.out.println(dp[n]);
	}
}
