import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt(),m=sc.nextInt();
		int[] a = new int[n+1];
		for(int i=0;i<m;i++)a[sc.nextInt()-1]++;
		long sum=0,n1=2,n2=1;
		if(a[0]!=0) {
			n2=0;
			n1=1;
		}
		if(a[1]!=0)n1=0;
		for(int i=3;i<=n;i++) {
			if(a[i-1]!=0)sum=0;
			else sum=(n1+n2)%1000000007;
			n2=n1;
			n1=sum;
		}
		if(n==2)sum=n1;
		if(n==1)sum=n2;
		if(sum<0)sum=0;
		System.out.print(sum);

	}
}
 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(),m=sc.nextInt();
		int[] a = new int[n+1];
		for(int i=0;i<m;i++)a[sc.nextInt()-1]++;
		long sum=0,n1=2,n2=1;
		if(a[0]!=0) {
			n2=0;
			n1=1;
		}
		if(a[1]!=0)n1=0;
		for(int i=3;i<=n;i++) {
			if(a[i-1]!=0)sum=0;
			else sum=(n1+n2)%1000000007;
			n2=n1;
			n1=sum;
		}
		if(n==2)sum=n1;
		if(n==1)sum=n2;
		if(sum<0)sum=0;
		System.out.print(sum);

	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt(),m=sc.nextInt();
		int[] a = new int[n+1];
		for(int i=0;i<m;i++)a[sc.nextInt()-1]++;
		long sum=0,n1=2,n2=1;
		if(a[0]!=0) {
			n2=0;
			n1=1;
		}
		if(a[1]!=0)n1=0;
		for(int i=3;i<=n;i++) {
			if(a[i-1]!=0)sum=0;
			else sum=(n1+n2)%1000000007;
			n2=n1;
			n1=sum;
		}
		if(n==2)sum=n1;
		if(n==1)sum=n2;
		if(sum<0)sum=0;
		System.out.print(sum);

	} main {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt(),m=sc.nextInt();
		int[] a = new int[n+1];
		for(int i=0;i<m;i++)a[sc.nextInt()-1]++;
		long sum=0,n1=2,n2=1;
		if(a[0]!=0) {
			n2=0;
			n1=1;
		}
		if(a[1]!=0)n1=0;
		for(int i=3;i<=n;i++) {
			if(a[i-1]!=0)sum=0;
			else sum=(n1+n2)%1000000007;
			n2=n1;
			n1=sum;
		}
		if(n==2)sum=n1;
		if(n==1)sum=n2;
		if(sum<0)sum=0;
		System.out.print(sum);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt() n sc.nextInt() sc.nextInt sc m=sc.nextInt(); m sc.nextInt() sc.nextInt sc int[] a = new int[n+1]; a new int[n+1] n+1 n 1 for(int i=0;i<m;i++)a[sc.nextInt()-1]++; int i=0; int i=0; i 0 i<m i m i++ i++ i a[sc.nextInt()-1]++; a[sc.nextInt()-1]++ a[sc.nextInt()-1] a sc.nextInt()-1 sc.nextInt() sc.nextInt sc 1 long sum=0 sum 0 n1=2 n1 2 n2=1; n2 1 if(a[0]!=0) {
			n2=0;
			n1=1;
		} a[0]!=0 a[0] a 0 0 {
			n2=0;
			n1=1;
		} n2=0 n2 0 n1=1 n1 1 if(a[1]!=0)n1=0; a[1]!=0 a[1] a 1 0 n1=0 n1 0 for(int i=3;i<=n;i++) {
			if(a[i-1]!=0)sum=0;
			else sum=(n1+n2)%1000000007;
			n2=n1;
			n1=sum;
		} int i=3; int i=3; i 3 i<=n i n i++ i++ i {
			if(a[i-1]!=0)sum=0;
			else sum=(n1+n2)%1000000007;
			n2=n1;
			n1=sum;
		} {
			if(a[i-1]!=0)sum=0;
			else sum=(n1+n2)%1000000007;
			n2=n1;
			n1=sum;
		} if(a[i-1]!=0)sum=0;
			else sum=(n1+n2)%1000000007; a[i-1]!=0 a[i-1] a i-1 i 1 0 sum=0 sum 0 sum=(n1+n2)%1000000007 sum (n1+n2)%1000000007 (n1+n2) n1 n2 1000000007 n2=n1 n2 n1 n1=sum n1 sum if(n==2)sum=n1; n==2 n 2 sum=n1 sum n1 if(n==1)sum=n2; n==1 n 1 sum=n2 sum n2 if(sum<0)sum=0; sum<0 sum 0 sum=0 sum 0 System.out.print(sum) System.out.print System.out System System.out sum String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt(),m=sc.nextInt();
		int[] a = new int[n+1];
		for(int i=0;i<m;i++)a[sc.nextInt()-1]++;
		long sum=0,n1=2,n2=1;
		if(a[0]!=0) {
			n2=0;
			n1=1;
		}
		if(a[1]!=0)n1=0;
		for(int i=3;i<=n;i++) {
			if(a[i-1]!=0)sum=0;
			else sum=(n1+n2)%1000000007;
			n2=n1;
			n1=sum;
		}
		if(n==2)sum=n1;
		if(n==1)sum=n2;
		if(sum<0)sum=0;
		System.out.print(sum);

	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt(),m=sc.nextInt();
		int[] a = new int[n+1];
		for(int i=0;i<m;i++)a[sc.nextInt()-1]++;
		long sum=0,n1=2,n2=1;
		if(a[0]!=0) {
			n2=0;
			n1=1;
		}
		if(a[1]!=0)n1=0;
		for(int i=3;i<=n;i++) {
			if(a[i-1]!=0)sum=0;
			else sum=(n1+n2)%1000000007;
			n2=n1;
			n1=sum;
		}
		if(n==2)sum=n1;
		if(n==1)sum=n2;
		if(sum<0)sum=0;
		System.out.print(sum);

	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt(),m=sc.nextInt();
		int[] a = new int[n+1];
		for(int i=0;i<m;i++)a[sc.nextInt()-1]++;
		long sum=0,n1=2,n2=1;
		if(a[0]!=0) {
			n2=0;
			n1=1;
		}
		if(a[1]!=0)n1=0;
		for(int i=3;i<=n;i++) {
			if(a[i-1]!=0)sum=0;
			else sum=(n1+n2)%1000000007;
			n2=n1;
			n1=sum;
		}
		if(n==2)sum=n1;
		if(n==1)sum=n2;
		if(sum<0)sum=0;
		System.out.print(sum);

	}
}

