import java.util.Scanner;
public class Main {

	static long ln = 1000000007;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		long fibdp[] = new long[n+1];
		fibdp[0] = 1;
		fibdp[1] = 1;
		for(int i=2;i<=n;i++) {
			fibdp[i] = (fibdp[i-1] + fibdp[i-2])%ln;
		}
		int[] a = null;
		if(m!=0) {
			a = new int[m];
			for(int i=0;i<m;i++) {
				a[i] = sc.nextInt();
			}
		}
		long ans;
		if(m!=0)
			ans = fib(a[0] -1, fibdp)% ln;
		else
			ans = fib(n, fibdp)%ln;
		
		for(int i=1;i<m;i++) {
			if(a[i]-a[i-1] == 0) {
				ans = 0;
				break;
			}
			ans = (ans * (fib(a[i]-a[i-1]-2, fibdp)% ln)) %ln;
		}
		if(m!=0)
			ans = (ans * (fib(n - a[m-1] -1, fibdp)% ln)) %ln;
		
		System.out.print(ans);
	}
	
	public static long fib(int i, long[] fibdp) {
		if(i<0)
			return 0;
		else 
			return fibdp[i];
	}
} import java.util.Scanner; Scanner java.util public class Main {

	static long ln = 1000000007;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		long fibdp[] = new long[n+1];
		fibdp[0] = 1;
		fibdp[1] = 1;
		for(int i=2;i<=n;i++) {
			fibdp[i] = (fibdp[i-1] + fibdp[i-2])%ln;
		}
		int[] a = null;
		if(m!=0) {
			a = new int[m];
			for(int i=0;i<m;i++) {
				a[i] = sc.nextInt();
			}
		}
		long ans;
		if(m!=0)
			ans = fib(a[0] -1, fibdp)% ln;
		else
			ans = fib(n, fibdp)%ln;
		
		for(int i=1;i<m;i++) {
			if(a[i]-a[i-1] == 0) {
				ans = 0;
				break;
			}
			ans = (ans * (fib(a[i]-a[i-1]-2, fibdp)% ln)) %ln;
		}
		if(m!=0)
			ans = (ans * (fib(n - a[m-1] -1, fibdp)% ln)) %ln;
		
		System.out.print(ans);
	}
	
	public static long fib(int i, long[] fibdp) {
		if(i<0)
			return 0;
		else 
			return fibdp[i];
	}
} Main static long ln = 1000000007; ln 1000000007 public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		long fibdp[] = new long[n+1];
		fibdp[0] = 1;
		fibdp[1] = 1;
		for(int i=2;i<=n;i++) {
			fibdp[i] = (fibdp[i-1] + fibdp[i-2])%ln;
		}
		int[] a = null;
		if(m!=0) {
			a = new int[m];
			for(int i=0;i<m;i++) {
				a[i] = sc.nextInt();
			}
		}
		long ans;
		if(m!=0)
			ans = fib(a[0] -1, fibdp)% ln;
		else
			ans = fib(n, fibdp)%ln;
		
		for(int i=1;i<m;i++) {
			if(a[i]-a[i-1] == 0) {
				ans = 0;
				break;
			}
			ans = (ans * (fib(a[i]-a[i-1]-2, fibdp)% ln)) %ln;
		}
		if(m!=0)
			ans = (ans * (fib(n - a[m-1] -1, fibdp)% ln)) %ln;
		
		System.out.print(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		long fibdp[] = new long[n+1];
		fibdp[0] = 1;
		fibdp[1] = 1;
		for(int i=2;i<=n;i++) {
			fibdp[i] = (fibdp[i-1] + fibdp[i-2])%ln;
		}
		int[] a = null;
		if(m!=0) {
			a = new int[m];
			for(int i=0;i<m;i++) {
				a[i] = sc.nextInt();
			}
		}
		long ans;
		if(m!=0)
			ans = fib(a[0] -1, fibdp)% ln;
		else
			ans = fib(n, fibdp)%ln;
		
		for(int i=1;i<m;i++) {
			if(a[i]-a[i-1] == 0) {
				ans = 0;
				break;
			}
			ans = (ans * (fib(a[i]-a[i-1]-2, fibdp)% ln)) %ln;
		}
		if(m!=0)
			ans = (ans * (fib(n - a[m-1] -1, fibdp)% ln)) %ln;
		
		System.out.print(ans);
	} 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 fibdp[] = new long[n+1]; fibdp new long[n+1] n+1 n 1 fibdp[0] = 1 fibdp[0] fibdp 0 1 fibdp[1] = 1 fibdp[1] fibdp 1 1 for(int i=2;i<=n;i++) {
			fibdp[i] = (fibdp[i-1] + fibdp[i-2])%ln;
		} int i=2; int i=2; i 2 i<=n i n i++ i++ i {
			fibdp[i] = (fibdp[i-1] + fibdp[i-2])%ln;
		} {
			fibdp[i] = (fibdp[i-1] + fibdp[i-2])%ln;
		} fibdp[i] = (fibdp[i-1] + fibdp[i-2])%ln fibdp[i] fibdp i (fibdp[i-1] + fibdp[i-2])%ln (fibdp[i-1] + fibdp[i-2]) fibdp[i-1] fibdp i-1 i 1 fibdp[i-2] fibdp i-2 i 2 ln int[] a = null; a null if(m!=0) {
			a = new int[m];
			for(int i=0;i<m;i++) {
				a[i] = sc.nextInt();
			}
		} m!=0 m 0 {
			a = new int[m];
			for(int i=0;i<m;i++) {
				a[i] = sc.nextInt();
			}
		} a = new int[m] a new int[m] m for(int i=0;i<m;i++) {
				a[i] = sc.nextInt();
			} int i=0; int i=0; i 0 i<m i m i++ i++ i {
				a[i] = sc.nextInt();
			} {
				a[i] = sc.nextInt();
			} a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc long ans; ans if(m!=0)
			ans = fib(a[0] -1, fibdp)% ln;
		else
			ans = fib(n, fibdp)%ln; m!=0 m 0 ans = fib(a[0] -1, fibdp)% ln ans fib(a[0] -1, fibdp)% ln fib(a[0] -1, fibdp) fib a[0] -1 a[0] a 0 1 fibdp ln ans = fib(n, fibdp)%ln ans fib(n, fibdp)%ln fib(n, fibdp) fib n fibdp ln for(int i=1;i<m;i++) {
			if(a[i]-a[i-1] == 0) {
				ans = 0;
				break;
			}
			ans = (ans * (fib(a[i]-a[i-1]-2, fibdp)% ln)) %ln;
		} int i=1; int i=1; i 1 i<m i m i++ i++ i {
			if(a[i]-a[i-1] == 0) {
				ans = 0;
				break;
			}
			ans = (ans * (fib(a[i]-a[i-1]-2, fibdp)% ln)) %ln;
		} {
			if(a[i]-a[i-1] == 0) {
				ans = 0;
				break;
			}
			ans = (ans * (fib(a[i]-a[i-1]-2, fibdp)% ln)) %ln;
		} if(a[i]-a[i-1] == 0) {
				ans = 0;
				break;
			} a[i]-a[i-1] == 0 a[i]-a[i-1] a[i] a i a[i-1] a i-1 i 1 0 {
				ans = 0;
				break;
			} ans = 0 ans 0 break; ans = (ans * (fib(a[i]-a[i-1]-2, fibdp)% ln)) %ln ans (ans * (fib(a[i]-a[i-1]-2, fibdp)% ln)) %ln (ans * (fib(a[i]-a[i-1]-2, fibdp)% ln)) ans (fib(a[i]-a[i-1]-2, fibdp)% ln) fib(a[i]-a[i-1]-2, fibdp) fib a[i]-a[i-1]-2 a[i]-a[i-1]-2 a[i] a i a[i-1] a i-1 i 1 2 fibdp ln ln if(m!=0)
			ans = (ans * (fib(n - a[m-1] -1, fibdp)% ln)) %ln; m!=0 m 0 ans = (ans * (fib(n - a[m-1] -1, fibdp)% ln)) %ln ans (ans * (fib(n - a[m-1] -1, fibdp)% ln)) %ln (ans * (fib(n - a[m-1] -1, fibdp)% ln)) ans (fib(n - a[m-1] -1, fibdp)% ln) fib(n - a[m-1] -1, fibdp) fib n - a[m-1] -1 n - a[m-1] -1 n a[m-1] a m-1 m 1 1 fibdp ln ln System.out.print(ans) System.out.print System.out System System.out ans String[] args args public static long fib(int i, long[] fibdp) {
		if(i<0)
			return 0;
		else 
			return fibdp[i];
	} fib {
		if(i<0)
			return 0;
		else 
			return fibdp[i];
	} if(i<0)
			return 0;
		else 
			return fibdp[i]; i<0 i 0 return 0; 0 return fibdp[i]; fibdp[i] fibdp i int i i long[] fibdp fibdp public class Main {

	static long ln = 1000000007;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		long fibdp[] = new long[n+1];
		fibdp[0] = 1;
		fibdp[1] = 1;
		for(int i=2;i<=n;i++) {
			fibdp[i] = (fibdp[i-1] + fibdp[i-2])%ln;
		}
		int[] a = null;
		if(m!=0) {
			a = new int[m];
			for(int i=0;i<m;i++) {
				a[i] = sc.nextInt();
			}
		}
		long ans;
		if(m!=0)
			ans = fib(a[0] -1, fibdp)% ln;
		else
			ans = fib(n, fibdp)%ln;
		
		for(int i=1;i<m;i++) {
			if(a[i]-a[i-1] == 0) {
				ans = 0;
				break;
			}
			ans = (ans * (fib(a[i]-a[i-1]-2, fibdp)% ln)) %ln;
		}
		if(m!=0)
			ans = (ans * (fib(n - a[m-1] -1, fibdp)% ln)) %ln;
		
		System.out.print(ans);
	}
	
	public static long fib(int i, long[] fibdp) {
		if(i<0)
			return 0;
		else 
			return fibdp[i];
	}
} public class Main {

	static long ln = 1000000007;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		long fibdp[] = new long[n+1];
		fibdp[0] = 1;
		fibdp[1] = 1;
		for(int i=2;i<=n;i++) {
			fibdp[i] = (fibdp[i-1] + fibdp[i-2])%ln;
		}
		int[] a = null;
		if(m!=0) {
			a = new int[m];
			for(int i=0;i<m;i++) {
				a[i] = sc.nextInt();
			}
		}
		long ans;
		if(m!=0)
			ans = fib(a[0] -1, fibdp)% ln;
		else
			ans = fib(n, fibdp)%ln;
		
		for(int i=1;i<m;i++) {
			if(a[i]-a[i-1] == 0) {
				ans = 0;
				break;
			}
			ans = (ans * (fib(a[i]-a[i-1]-2, fibdp)% ln)) %ln;
		}
		if(m!=0)
			ans = (ans * (fib(n - a[m-1] -1, fibdp)% ln)) %ln;
		
		System.out.print(ans);
	}
	
	public static long fib(int i, long[] fibdp) {
		if(i<0)
			return 0;
		else 
			return fibdp[i];
	}
} Main
import java.util.Scanner;
public class Main {

	static long ln = 1000000007;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int m=sc.nextInt();
		long fibdp[] = new long[n+1];
		fibdp[0] = 1;
		fibdp[1] = 1;
		for(int i=2;i<=n;i++) {
			fibdp[i] = (fibdp[i-1] + fibdp[i-2])%ln;
		}
		int[] a = null;
		if(m!=0) {
			a = new int[m];
			for(int i=0;i<m;i++) {
				a[i] = sc.nextInt();
			}
		}
		long ans;
		if(m!=0)
			ans = fib(a[0] -1, fibdp)% ln;
		else
			ans = fib(n, fibdp)%ln;
		
		for(int i=1;i<m;i++) {
			if(a[i]-a[i-1] == 0) {
				ans = 0;
				break;
			}
			ans = (ans * (fib(a[i]-a[i-1]-2, fibdp)% ln)) %ln;
		}
		if(m!=0)
			ans = (ans * (fib(n - a[m-1] -1, fibdp)% ln)) %ln;
		
		System.out.print(ans);
	}
	
	public static long fib(int i, long[] fibdp) {
		if(i<0)
			return 0;
		else 
			return fibdp[i];
	}
}