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[] a = new long[M];
		
		long c = 1000000007;
		
		long[] fib = new long[N + 2];
		fib[0] = 1;
		fib[1] = 1;
		fib[2] = 2;
		
		for(int i = 3; i <= N + 1; i++) {
			fib[i] = fib[i - 1] + fib[i - 2];
			fib[i] = fib[i] % c;
		}
		 
		if(M == 0) {
			System.out.println(fib[N]);
			return;
		}
		
		for(int i = 0; i < M; i++) {
			a[i] = sc.nextInt();
			if(i > 0 && a[i] - 1 == a[i - 1]) {
				System.out.println(0);
				return;
			}
		}
		
		int now = 0;
		int x = 0;
		long sum = 1;
		int temp = 0;
		
		while(temp < N) {
			now++;
			temp++;
			if(x < M) {
				if(temp == a[x]) {
					sum = sum % c * fib[now - 1] % c;
					x++;
					now = -1;
				}
			}
		}
		sum = sum % c * fib[now] % c;
		System.out.println(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();
		int M = sc.nextInt();
		long[] a = new long[M];
		
		long c = 1000000007;
		
		long[] fib = new long[N + 2];
		fib[0] = 1;
		fib[1] = 1;
		fib[2] = 2;
		
		for(int i = 3; i <= N + 1; i++) {
			fib[i] = fib[i - 1] + fib[i - 2];
			fib[i] = fib[i] % c;
		}
		 
		if(M == 0) {
			System.out.println(fib[N]);
			return;
		}
		
		for(int i = 0; i < M; i++) {
			a[i] = sc.nextInt();
			if(i > 0 && a[i] - 1 == a[i - 1]) {
				System.out.println(0);
				return;
			}
		}
		
		int now = 0;
		int x = 0;
		long sum = 1;
		int temp = 0;
		
		while(temp < N) {
			now++;
			temp++;
			if(x < M) {
				if(temp == a[x]) {
					sum = sum % c * fib[now - 1] % c;
					x++;
					now = -1;
				}
			}
		}
		sum = sum % c * fib[now] % c;
		System.out.println(sum);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		long[] a = new long[M];
		
		long c = 1000000007;
		
		long[] fib = new long[N + 2];
		fib[0] = 1;
		fib[1] = 1;
		fib[2] = 2;
		
		for(int i = 3; i <= N + 1; i++) {
			fib[i] = fib[i - 1] + fib[i - 2];
			fib[i] = fib[i] % c;
		}
		 
		if(M == 0) {
			System.out.println(fib[N]);
			return;
		}
		
		for(int i = 0; i < M; i++) {
			a[i] = sc.nextInt();
			if(i > 0 && a[i] - 1 == a[i - 1]) {
				System.out.println(0);
				return;
			}
		}
		
		int now = 0;
		int x = 0;
		long sum = 1;
		int temp = 0;
		
		while(temp < N) {
			now++;
			temp++;
			if(x < M) {
				if(temp == a[x]) {
					sum = sum % c * fib[now - 1] % c;
					x++;
					now = -1;
				}
			}
		}
		sum = sum % c * fib[now] % c;
		System.out.println(sum);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		long[] a = new long[M];
		
		long c = 1000000007;
		
		long[] fib = new long[N + 2];
		fib[0] = 1;
		fib[1] = 1;
		fib[2] = 2;
		
		for(int i = 3; i <= N + 1; i++) {
			fib[i] = fib[i - 1] + fib[i - 2];
			fib[i] = fib[i] % c;
		}
		 
		if(M == 0) {
			System.out.println(fib[N]);
			return;
		}
		
		for(int i = 0; i < M; i++) {
			a[i] = sc.nextInt();
			if(i > 0 && a[i] - 1 == a[i - 1]) {
				System.out.println(0);
				return;
			}
		}
		
		int now = 0;
		int x = 0;
		long sum = 1;
		int temp = 0;
		
		while(temp < N) {
			now++;
			temp++;
			if(x < M) {
				if(temp == a[x]) {
					sum = sum % c * fib[now - 1] % c;
					x++;
					now = -1;
				}
			}
		}
		sum = sum % c * fib[now] % c;
		System.out.println(sum);
	} 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[] a = new long[M]; a new long[M] M long c = 1000000007; c 1000000007 long[] fib = new long[N + 2]; fib new long[N + 2] N + 2 N 2 fib[0] = 1 fib[0] fib 0 1 fib[1] = 1 fib[1] fib 1 1 fib[2] = 2 fib[2] fib 2 2 for(int i = 3; i <= N + 1; i++) {
			fib[i] = fib[i - 1] + fib[i - 2];
			fib[i] = fib[i] % c;
		} int i = 3; int i = 3; i 3 i <= N + 1 i N + 1 N 1 i++ i++ i {
			fib[i] = fib[i - 1] + fib[i - 2];
			fib[i] = fib[i] % c;
		} {
			fib[i] = fib[i - 1] + fib[i - 2];
			fib[i] = fib[i] % c;
		} fib[i] = fib[i - 1] + fib[i - 2] fib[i] fib i fib[i - 1] + fib[i - 2] fib[i - 1] fib i - 1 i 1 fib[i - 2] fib i - 2 i 2 fib[i] = fib[i] % c fib[i] fib i fib[i] % c fib[i] fib i c if(M == 0) {
			System.out.println(fib[N]);
			return;
		} M == 0 M 0 {
			System.out.println(fib[N]);
			return;
		} System.out.println(fib[N]) System.out.println System.out System System.out fib[N] fib N return; for(int i = 0; i < M; i++) {
			a[i] = sc.nextInt();
			if(i > 0 && a[i] - 1 == a[i - 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] - 1 == a[i - 1]) {
				System.out.println(0);
				return;
			}
		} {
			a[i] = sc.nextInt();
			if(i > 0 && a[i] - 1 == a[i - 1]) {
				System.out.println(0);
				return;
			}
		} a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc if(i > 0 && a[i] - 1 == a[i - 1]) {
				System.out.println(0);
				return;
			} i > 0 && a[i] - 1 == a[i - 1] i > 0 i 0 a[i] - 1 == a[i - 1] a[i] - 1 a[i] a i 1 a[i - 1] a i - 1 i 1 {
				System.out.println(0);
				return;
			} System.out.println(0) System.out.println System.out System System.out 0 return; int now = 0; now 0 int x = 0; x 0 long sum = 1; sum 1 int temp = 0; temp 0 while(temp < N) {
			now++;
			temp++;
			if(x < M) {
				if(temp == a[x]) {
					sum = sum % c * fib[now - 1] % c;
					x++;
					now = -1;
				}
			}
		} temp < N temp N {
			now++;
			temp++;
			if(x < M) {
				if(temp == a[x]) {
					sum = sum % c * fib[now - 1] % c;
					x++;
					now = -1;
				}
			}
		} now++ now temp++ temp if(x < M) {
				if(temp == a[x]) {
					sum = sum % c * fib[now - 1] % c;
					x++;
					now = -1;
				}
			} x < M x M {
				if(temp == a[x]) {
					sum = sum % c * fib[now - 1] % c;
					x++;
					now = -1;
				}
			} if(temp == a[x]) {
					sum = sum % c * fib[now - 1] % c;
					x++;
					now = -1;
				} temp == a[x] temp a[x] a x {
					sum = sum % c * fib[now - 1] % c;
					x++;
					now = -1;
				} sum = sum % c * fib[now - 1] % c sum sum % c * fib[now - 1] % c sum % c * fib[now - 1] sum % c sum c fib[now - 1] fib now - 1 now 1 c x++ x now = -1 now -1 1 sum = sum % c * fib[now] % c sum sum % c * fib[now] % c sum % c * fib[now] sum % c sum c fib[now] fib now c System.out.println(sum) System.out.println 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();
		int M = sc.nextInt();
		long[] a = new long[M];
		
		long c = 1000000007;
		
		long[] fib = new long[N + 2];
		fib[0] = 1;
		fib[1] = 1;
		fib[2] = 2;
		
		for(int i = 3; i <= N + 1; i++) {
			fib[i] = fib[i - 1] + fib[i - 2];
			fib[i] = fib[i] % c;
		}
		 
		if(M == 0) {
			System.out.println(fib[N]);
			return;
		}
		
		for(int i = 0; i < M; i++) {
			a[i] = sc.nextInt();
			if(i > 0 && a[i] - 1 == a[i - 1]) {
				System.out.println(0);
				return;
			}
		}
		
		int now = 0;
		int x = 0;
		long sum = 1;
		int temp = 0;
		
		while(temp < N) {
			now++;
			temp++;
			if(x < M) {
				if(temp == a[x]) {
					sum = sum % c * fib[now - 1] % c;
					x++;
					now = -1;
				}
			}
		}
		sum = sum % c * fib[now] % c;
		System.out.println(sum);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		long[] a = new long[M];
		
		long c = 1000000007;
		
		long[] fib = new long[N + 2];
		fib[0] = 1;
		fib[1] = 1;
		fib[2] = 2;
		
		for(int i = 3; i <= N + 1; i++) {
			fib[i] = fib[i - 1] + fib[i - 2];
			fib[i] = fib[i] % c;
		}
		 
		if(M == 0) {
			System.out.println(fib[N]);
			return;
		}
		
		for(int i = 0; i < M; i++) {
			a[i] = sc.nextInt();
			if(i > 0 && a[i] - 1 == a[i - 1]) {
				System.out.println(0);
				return;
			}
		}
		
		int now = 0;
		int x = 0;
		long sum = 1;
		int temp = 0;
		
		while(temp < N) {
			now++;
			temp++;
			if(x < M) {
				if(temp == a[x]) {
					sum = sum % c * fib[now - 1] % c;
					x++;
					now = -1;
				}
			}
		}
		sum = sum % c * fib[now] % c;
		System.out.println(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();
		int M = sc.nextInt();
		long[] a = new long[M];
		
		long c = 1000000007;
		
		long[] fib = new long[N + 2];
		fib[0] = 1;
		fib[1] = 1;
		fib[2] = 2;
		
		for(int i = 3; i <= N + 1; i++) {
			fib[i] = fib[i - 1] + fib[i - 2];
			fib[i] = fib[i] % c;
		}
		 
		if(M == 0) {
			System.out.println(fib[N]);
			return;
		}
		
		for(int i = 0; i < M; i++) {
			a[i] = sc.nextInt();
			if(i > 0 && a[i] - 1 == a[i - 1]) {
				System.out.println(0);
				return;
			}
		}
		
		int now = 0;
		int x = 0;
		long sum = 1;
		int temp = 0;
		
		while(temp < N) {
			now++;
			temp++;
			if(x < M) {
				if(temp == a[x]) {
					sum = sum % c * fib[now - 1] % c;
					x++;
					now = -1;
				}
			}
		}
		sum = sum % c * fib[now] % c;
		System.out.println(sum);
	}
}
