import java.util.*;

public class Main {
	public static void main(String[] args) {
		int i;
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		int[] a = new int[m+2];
		a[0] = -1;
		for(i = 1; i <=m; i++) {
			a[i] = Integer.parseInt(sc.next());
		}
		sc.close();
		long[] fi = new long[100000+1];
		fi[0] = fi[1] = 1;
		for(i = 2; i < fi.length; i++) {
			fi[i] = fi[i-1] + fi[i-2];
			if(fi[i] >= 1000000007) fi[i] %= 1000000007;
		}
		a[m+1] = n+1;
		long cnt = 1;
		int dif = 0;
		for(i = 1; i <= m+1; i++) {
			dif = a[i] - a[i-1] -2;
//			System.out.println("dif:"+dif);
			if(dif == -1) {
				cnt = 0;
				break;
			}
//			System.out.println("fib("+dif+")");
			cnt *= fi[dif];
//			System.out.println("cnt:"+cnt);
			if(cnt >= 1000000007) {
				cnt %= 1000000007;
				if(cnt==0)break;
			}
		}
		System.out.println(cnt);
//		System.out.println(cnt%1000000007);
	}
	
	public static int fib(int n) {
		if(n == 0 || n == 1) return 1;
		return fib(n-1)+fib(n-2);
	}

} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		int i;
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		int[] a = new int[m+2];
		a[0] = -1;
		for(i = 1; i <=m; i++) {
			a[i] = Integer.parseInt(sc.next());
		}
		sc.close();
		long[] fi = new long[100000+1];
		fi[0] = fi[1] = 1;
		for(i = 2; i < fi.length; i++) {
			fi[i] = fi[i-1] + fi[i-2];
			if(fi[i] >= 1000000007) fi[i] %= 1000000007;
		}
		a[m+1] = n+1;
		long cnt = 1;
		int dif = 0;
		for(i = 1; i <= m+1; i++) {
			dif = a[i] - a[i-1] -2;
//			System.out.println("dif:"+dif);
			if(dif == -1) {
				cnt = 0;
				break;
			}
//			System.out.println("fib("+dif+")");
			cnt *= fi[dif];
//			System.out.println("cnt:"+cnt);
			if(cnt >= 1000000007) {
				cnt %= 1000000007;
				if(cnt==0)break;
			}
		}
		System.out.println(cnt);
//		System.out.println(cnt%1000000007);
	}
	
	public static int fib(int n) {
		if(n == 0 || n == 1) return 1;
		return fib(n-1)+fib(n-2);
	}

} Main public static void main(String[] args) {
		int i;
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		int[] a = new int[m+2];
		a[0] = -1;
		for(i = 1; i <=m; i++) {
			a[i] = Integer.parseInt(sc.next());
		}
		sc.close();
		long[] fi = new long[100000+1];
		fi[0] = fi[1] = 1;
		for(i = 2; i < fi.length; i++) {
			fi[i] = fi[i-1] + fi[i-2];
			if(fi[i] >= 1000000007) fi[i] %= 1000000007;
		}
		a[m+1] = n+1;
		long cnt = 1;
		int dif = 0;
		for(i = 1; i <= m+1; i++) {
			dif = a[i] - a[i-1] -2;
//			System.out.println("dif:"+dif);
			if(dif == -1) {
				cnt = 0;
				break;
			}
//			System.out.println("fib("+dif+")");
			cnt *= fi[dif];
//			System.out.println("cnt:"+cnt);
			if(cnt >= 1000000007) {
				cnt %= 1000000007;
				if(cnt==0)break;
			}
		}
		System.out.println(cnt);
//		System.out.println(cnt%1000000007);
	} main {
		int i;
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		int[] a = new int[m+2];
		a[0] = -1;
		for(i = 1; i <=m; i++) {
			a[i] = Integer.parseInt(sc.next());
		}
		sc.close();
		long[] fi = new long[100000+1];
		fi[0] = fi[1] = 1;
		for(i = 2; i < fi.length; i++) {
			fi[i] = fi[i-1] + fi[i-2];
			if(fi[i] >= 1000000007) fi[i] %= 1000000007;
		}
		a[m+1] = n+1;
		long cnt = 1;
		int dif = 0;
		for(i = 1; i <= m+1; i++) {
			dif = a[i] - a[i-1] -2;
//			System.out.println("dif:"+dif);
			if(dif == -1) {
				cnt = 0;
				break;
			}
//			System.out.println("fib("+dif+")");
			cnt *= fi[dif];
//			System.out.println("cnt:"+cnt);
			if(cnt >= 1000000007) {
				cnt %= 1000000007;
				if(cnt==0)break;
			}
		}
		System.out.println(cnt);
//		System.out.println(cnt%1000000007);
	} int i; i Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int m = Integer.parseInt(sc.next()); m Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[] a = new int[m+2]; a new int[m+2] m+2 m 2 a[0] = -1 a[0] a 0 -1 1 for(i = 1; i <=m; i++) {
			a[i] = Integer.parseInt(sc.next());
		} i = 1; i = 1 i 1 i <=m i m i++ i++ i {
			a[i] = Integer.parseInt(sc.next());
		} {
			a[i] = Integer.parseInt(sc.next());
		} a[i] = Integer.parseInt(sc.next()) a[i] a i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc sc.close() sc.close sc long[] fi = new long[100000+1]; fi new long[100000+1] 100000+1 100000 1 fi[0] = fi[1] = 1 fi[0] fi 0 fi[1] = 1 fi[1] fi 1 1 for(i = 2; i < fi.length; i++) {
			fi[i] = fi[i-1] + fi[i-2];
			if(fi[i] >= 1000000007) fi[i] %= 1000000007;
		} i = 2; i = 2 i 2 i < fi.length i fi.length fi fi.length i++ i++ i {
			fi[i] = fi[i-1] + fi[i-2];
			if(fi[i] >= 1000000007) fi[i] %= 1000000007;
		} {
			fi[i] = fi[i-1] + fi[i-2];
			if(fi[i] >= 1000000007) fi[i] %= 1000000007;
		} fi[i] = fi[i-1] + fi[i-2] fi[i] fi i fi[i-1] + fi[i-2] fi[i-1] fi i-1 i 1 fi[i-2] fi i-2 i 2 if(fi[i] >= 1000000007) fi[i] %= 1000000007; fi[i] >= 1000000007 fi[i] fi i 1000000007 fi[i] %= 1000000007 fi[i] fi i 1000000007 a[m+1] = n+1 a[m+1] a m+1 m 1 n+1 n 1 long cnt = 1; cnt 1 int dif = 0; dif 0 for(i = 1; i <= m+1; i++) {
			dif = a[i] - a[i-1] -2;
//			System.out.println("dif:"+dif);
			if(dif == -1) {
				cnt = 0;
				break;
			}
//			System.out.println("fib("+dif+")");
			cnt *= fi[dif];
//			System.out.println("cnt:"+cnt);
			if(cnt >= 1000000007) {
				cnt %= 1000000007;
				if(cnt==0)break;
			}
		} i = 1; i = 1 i 1 i <= m+1 i m+1 m 1 i++ i++ i {
			dif = a[i] - a[i-1] -2;
//			System.out.println("dif:"+dif);
			if(dif == -1) {
				cnt = 0;
				break;
			}
//			System.out.println("fib("+dif+")");
			cnt *= fi[dif];
//			System.out.println("cnt:"+cnt);
			if(cnt >= 1000000007) {
				cnt %= 1000000007;
				if(cnt==0)break;
			}
		} {
			dif = a[i] - a[i-1] -2;
//			System.out.println("dif:"+dif);
			if(dif == -1) {
				cnt = 0;
				break;
			}
//			System.out.println("fib("+dif+")");
			cnt *= fi[dif];
//			System.out.println("cnt:"+cnt);
			if(cnt >= 1000000007) {
				cnt %= 1000000007;
				if(cnt==0)break;
			}
		} dif = a[i] - a[i-1] -2 dif 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 if(dif == -1) {
				cnt = 0;
				break;
			} dif == -1 dif -1 1 {
				cnt = 0;
				break;
			} cnt = 0 cnt 0 break; cnt *= fi[dif] cnt fi[dif] fi dif if(cnt >= 1000000007) {
				cnt %= 1000000007;
				if(cnt==0)break;
			} cnt >= 1000000007 cnt 1000000007 {
				cnt %= 1000000007;
				if(cnt==0)break;
			} cnt %= 1000000007 cnt 1000000007 if(cnt==0)break; cnt==0 cnt 0 break; System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public static int fib(int n) {
		if(n == 0 || n == 1) return 1;
		return fib(n-1)+fib(n-2);
	} fib {
		if(n == 0 || n == 1) return 1;
		return fib(n-1)+fib(n-2);
	} if(n == 0 || n == 1) return 1; n == 0 || n == 1 n == 0 n 0 n == 1 n 1 return 1; 1 return fib(n-1)+fib(n-2); fib(n-1)+fib(n-2) fib(n-1) fib n-1 n 1 fib(n-2) fib n-2 n 2 int n n public class Main {
	public static void main(String[] args) {
		int i;
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		int[] a = new int[m+2];
		a[0] = -1;
		for(i = 1; i <=m; i++) {
			a[i] = Integer.parseInt(sc.next());
		}
		sc.close();
		long[] fi = new long[100000+1];
		fi[0] = fi[1] = 1;
		for(i = 2; i < fi.length; i++) {
			fi[i] = fi[i-1] + fi[i-2];
			if(fi[i] >= 1000000007) fi[i] %= 1000000007;
		}
		a[m+1] = n+1;
		long cnt = 1;
		int dif = 0;
		for(i = 1; i <= m+1; i++) {
			dif = a[i] - a[i-1] -2;
//			System.out.println("dif:"+dif);
			if(dif == -1) {
				cnt = 0;
				break;
			}
//			System.out.println("fib("+dif+")");
			cnt *= fi[dif];
//			System.out.println("cnt:"+cnt);
			if(cnt >= 1000000007) {
				cnt %= 1000000007;
				if(cnt==0)break;
			}
		}
		System.out.println(cnt);
//		System.out.println(cnt%1000000007);
	}
	
	public static int fib(int n) {
		if(n == 0 || n == 1) return 1;
		return fib(n-1)+fib(n-2);
	}

} public class Main {
	public static void main(String[] args) {
		int i;
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		int[] a = new int[m+2];
		a[0] = -1;
		for(i = 1; i <=m; i++) {
			a[i] = Integer.parseInt(sc.next());
		}
		sc.close();
		long[] fi = new long[100000+1];
		fi[0] = fi[1] = 1;
		for(i = 2; i < fi.length; i++) {
			fi[i] = fi[i-1] + fi[i-2];
			if(fi[i] >= 1000000007) fi[i] %= 1000000007;
		}
		a[m+1] = n+1;
		long cnt = 1;
		int dif = 0;
		for(i = 1; i <= m+1; i++) {
			dif = a[i] - a[i-1] -2;
//			System.out.println("dif:"+dif);
			if(dif == -1) {
				cnt = 0;
				break;
			}
//			System.out.println("fib("+dif+")");
			cnt *= fi[dif];
//			System.out.println("cnt:"+cnt);
			if(cnt >= 1000000007) {
				cnt %= 1000000007;
				if(cnt==0)break;
			}
		}
		System.out.println(cnt);
//		System.out.println(cnt%1000000007);
	}
	
	public static int fib(int n) {
		if(n == 0 || n == 1) return 1;
		return fib(n-1)+fib(n-2);
	}

} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		int i;
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int m = Integer.parseInt(sc.next());
		int[] a = new int[m+2];
		a[0] = -1;
		for(i = 1; i <=m; i++) {
			a[i] = Integer.parseInt(sc.next());
		}
		sc.close();
		long[] fi = new long[100000+1];
		fi[0] = fi[1] = 1;
		for(i = 2; i < fi.length; i++) {
			fi[i] = fi[i-1] + fi[i-2];
			if(fi[i] >= 1000000007) fi[i] %= 1000000007;
		}
		a[m+1] = n+1;
		long cnt = 1;
		int dif = 0;
		for(i = 1; i <= m+1; i++) {
			dif = a[i] - a[i-1] -2;
//			System.out.println("dif:"+dif);
			if(dif == -1) {
				cnt = 0;
				break;
			}
//			System.out.println("fib("+dif+")");
			cnt *= fi[dif];
//			System.out.println("cnt:"+cnt);
			if(cnt >= 1000000007) {
				cnt %= 1000000007;
				if(cnt==0)break;
			}
		}
		System.out.println(cnt);
//		System.out.println(cnt%1000000007);
	}
	
	public static int fib(int n) {
		if(n == 0 || n == 1) return 1;
		return fib(n-1)+fib(n-2);
	}

}
