import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		long[] s = new long[100007];
		int len = s.length;
		long mod = 1000000007;

		s[0] = 1;
		s[1] = 1;

		int i;
		for(i = 2; i < len; i++)
			s[i] = (s[i - 1] + s[i - 2]) % mod;

		int[] a = new int[m];

		for(i = 0; i < m; i++) {
			a[i] = scan.nextInt();
			if(i != 0) {
				if(a[i] - a[i - 1] == 1) {
					System.out.println(0);
					return;
				}
			}
		}
		if(m == 0) {
			System.out.println(s[n]);
		}else {

			int start;
			int end;
			long ans = 1;
			for(i = 0; i < m; i++) {
				if(i == 0) {
					start = 0;
					end = a[i] - 1;
				}else {
					start = a[i - 1] + 1;
					end = a[i] - 1;
				}
				ans = (ans * s[end - start]) % mod;
			}
			ans = (ans * s[n - (a[m - 1] + 1)]) % mod;
			System.out.println(ans);
		}


	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		long[] s = new long[100007];
		int len = s.length;
		long mod = 1000000007;

		s[0] = 1;
		s[1] = 1;

		int i;
		for(i = 2; i < len; i++)
			s[i] = (s[i - 1] + s[i - 2]) % mod;

		int[] a = new int[m];

		for(i = 0; i < m; i++) {
			a[i] = scan.nextInt();
			if(i != 0) {
				if(a[i] - a[i - 1] == 1) {
					System.out.println(0);
					return;
				}
			}
		}
		if(m == 0) {
			System.out.println(s[n]);
		}else {

			int start;
			int end;
			long ans = 1;
			for(i = 0; i < m; i++) {
				if(i == 0) {
					start = 0;
					end = a[i] - 1;
				}else {
					start = a[i - 1] + 1;
					end = a[i] - 1;
				}
				ans = (ans * s[end - start]) % mod;
			}
			ans = (ans * s[n - (a[m - 1] + 1)]) % mod;
			System.out.println(ans);
		}


	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		long[] s = new long[100007];
		int len = s.length;
		long mod = 1000000007;

		s[0] = 1;
		s[1] = 1;

		int i;
		for(i = 2; i < len; i++)
			s[i] = (s[i - 1] + s[i - 2]) % mod;

		int[] a = new int[m];

		for(i = 0; i < m; i++) {
			a[i] = scan.nextInt();
			if(i != 0) {
				if(a[i] - a[i - 1] == 1) {
					System.out.println(0);
					return;
				}
			}
		}
		if(m == 0) {
			System.out.println(s[n]);
		}else {

			int start;
			int end;
			long ans = 1;
			for(i = 0; i < m; i++) {
				if(i == 0) {
					start = 0;
					end = a[i] - 1;
				}else {
					start = a[i - 1] + 1;
					end = a[i] - 1;
				}
				ans = (ans * s[end - start]) % mod;
			}
			ans = (ans * s[n - (a[m - 1] + 1)]) % mod;
			System.out.println(ans);
		}


	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		long[] s = new long[100007];
		int len = s.length;
		long mod = 1000000007;

		s[0] = 1;
		s[1] = 1;

		int i;
		for(i = 2; i < len; i++)
			s[i] = (s[i - 1] + s[i - 2]) % mod;

		int[] a = new int[m];

		for(i = 0; i < m; i++) {
			a[i] = scan.nextInt();
			if(i != 0) {
				if(a[i] - a[i - 1] == 1) {
					System.out.println(0);
					return;
				}
			}
		}
		if(m == 0) {
			System.out.println(s[n]);
		}else {

			int start;
			int end;
			long ans = 1;
			for(i = 0; i < m; i++) {
				if(i == 0) {
					start = 0;
					end = a[i] - 1;
				}else {
					start = a[i - 1] + 1;
					end = a[i] - 1;
				}
				ans = (ans * s[end - start]) % mod;
			}
			ans = (ans * s[n - (a[m - 1] + 1)]) % mod;
			System.out.println(ans);
		}


	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int m = scan.nextInt(); m scan.nextInt() scan.nextInt scan long[] s = new long[100007]; s new long[100007] 100007 int len = s.length; len s.length s s.length long mod = 1000000007; mod 1000000007 s[0] = 1 s[0] s 0 1 s[1] = 1 s[1] s 1 1 int i; i for(i = 2; i < len; i++)
			s[i] = (s[i - 1] + s[i - 2]) % mod; i = 2; i = 2 i 2 i < len i len i++ i++ i s[i] = (s[i - 1] + s[i - 2]) % mod; s[i] = (s[i - 1] + s[i - 2]) % mod s[i] s i (s[i - 1] + s[i - 2]) % mod (s[i - 1] + s[i - 2]) s[i - 1] s i - 1 i 1 s[i - 2] s i - 2 i 2 mod int[] a = new int[m]; a new int[m] m for(i = 0; i < m; i++) {
			a[i] = scan.nextInt();
			if(i != 0) {
				if(a[i] - a[i - 1] == 1) {
					System.out.println(0);
					return;
				}
			}
		} i = 0; i = 0 i 0 i < m i m i++ i++ i {
			a[i] = scan.nextInt();
			if(i != 0) {
				if(a[i] - a[i - 1] == 1) {
					System.out.println(0);
					return;
				}
			}
		} {
			a[i] = scan.nextInt();
			if(i != 0) {
				if(a[i] - a[i - 1] == 1) {
					System.out.println(0);
					return;
				}
			}
		} a[i] = scan.nextInt() a[i] a i scan.nextInt() scan.nextInt scan if(i != 0) {
				if(a[i] - a[i - 1] == 1) {
					System.out.println(0);
					return;
				}
			} i != 0 i 0 {
				if(a[i] - a[i - 1] == 1) {
					System.out.println(0);
					return;
				}
			} if(a[i] - a[i - 1] == 1) {
					System.out.println(0);
					return;
				} a[i] - a[i - 1] == 1 a[i] - a[i - 1] a[i] a i 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; if(m == 0) {
			System.out.println(s[n]);
		}else {

			int start;
			int end;
			long ans = 1;
			for(i = 0; i < m; i++) {
				if(i == 0) {
					start = 0;
					end = a[i] - 1;
				}else {
					start = a[i - 1] + 1;
					end = a[i] - 1;
				}
				ans = (ans * s[end - start]) % mod;
			}
			ans = (ans * s[n - (a[m - 1] + 1)]) % mod;
			System.out.println(ans);
		} m == 0 m 0 {
			System.out.println(s[n]);
		} System.out.println(s[n]) System.out.println System.out System System.out s[n] s n {

			int start;
			int end;
			long ans = 1;
			for(i = 0; i < m; i++) {
				if(i == 0) {
					start = 0;
					end = a[i] - 1;
				}else {
					start = a[i - 1] + 1;
					end = a[i] - 1;
				}
				ans = (ans * s[end - start]) % mod;
			}
			ans = (ans * s[n - (a[m - 1] + 1)]) % mod;
			System.out.println(ans);
		} int start; start int end; end long ans = 1; ans 1 for(i = 0; i < m; i++) {
				if(i == 0) {
					start = 0;
					end = a[i] - 1;
				}else {
					start = a[i - 1] + 1;
					end = a[i] - 1;
				}
				ans = (ans * s[end - start]) % mod;
			} i = 0; i = 0 i 0 i < m i m i++ i++ i {
				if(i == 0) {
					start = 0;
					end = a[i] - 1;
				}else {
					start = a[i - 1] + 1;
					end = a[i] - 1;
				}
				ans = (ans * s[end - start]) % mod;
			} {
				if(i == 0) {
					start = 0;
					end = a[i] - 1;
				}else {
					start = a[i - 1] + 1;
					end = a[i] - 1;
				}
				ans = (ans * s[end - start]) % mod;
			} if(i == 0) {
					start = 0;
					end = a[i] - 1;
				}else {
					start = a[i - 1] + 1;
					end = a[i] - 1;
				} i == 0 i 0 {
					start = 0;
					end = a[i] - 1;
				} start = 0 start 0 end = a[i] - 1 end a[i] - 1 a[i] a i 1 {
					start = a[i - 1] + 1;
					end = a[i] - 1;
				} start = a[i - 1] + 1 start a[i - 1] + 1 a[i - 1] a i - 1 i 1 1 end = a[i] - 1 end a[i] - 1 a[i] a i 1 ans = (ans * s[end - start]) % mod ans (ans * s[end - start]) % mod (ans * s[end - start]) ans s[end - start] s end - start end start mod ans = (ans * s[n - (a[m - 1] + 1)]) % mod ans (ans * s[n - (a[m - 1] + 1)]) % mod (ans * s[n - (a[m - 1] + 1)]) ans s[n - (a[m - 1] + 1)] s n - (a[m - 1] + 1) n (a[m - 1] + 1) a[m - 1] a m - 1 m 1 1 mod System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		long[] s = new long[100007];
		int len = s.length;
		long mod = 1000000007;

		s[0] = 1;
		s[1] = 1;

		int i;
		for(i = 2; i < len; i++)
			s[i] = (s[i - 1] + s[i - 2]) % mod;

		int[] a = new int[m];

		for(i = 0; i < m; i++) {
			a[i] = scan.nextInt();
			if(i != 0) {
				if(a[i] - a[i - 1] == 1) {
					System.out.println(0);
					return;
				}
			}
		}
		if(m == 0) {
			System.out.println(s[n]);
		}else {

			int start;
			int end;
			long ans = 1;
			for(i = 0; i < m; i++) {
				if(i == 0) {
					start = 0;
					end = a[i] - 1;
				}else {
					start = a[i - 1] + 1;
					end = a[i] - 1;
				}
				ans = (ans * s[end - start]) % mod;
			}
			ans = (ans * s[n - (a[m - 1] + 1)]) % mod;
			System.out.println(ans);
		}


	}
} public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		long[] s = new long[100007];
		int len = s.length;
		long mod = 1000000007;

		s[0] = 1;
		s[1] = 1;

		int i;
		for(i = 2; i < len; i++)
			s[i] = (s[i - 1] + s[i - 2]) % mod;

		int[] a = new int[m];

		for(i = 0; i < m; i++) {
			a[i] = scan.nextInt();
			if(i != 0) {
				if(a[i] - a[i - 1] == 1) {
					System.out.println(0);
					return;
				}
			}
		}
		if(m == 0) {
			System.out.println(s[n]);
		}else {

			int start;
			int end;
			long ans = 1;
			for(i = 0; i < m; i++) {
				if(i == 0) {
					start = 0;
					end = a[i] - 1;
				}else {
					start = a[i - 1] + 1;
					end = a[i] - 1;
				}
				ans = (ans * s[end - start]) % mod;
			}
			ans = (ans * s[n - (a[m - 1] + 1)]) % mod;
			System.out.println(ans);
		}


	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int m = scan.nextInt();

		long[] s = new long[100007];
		int len = s.length;
		long mod = 1000000007;

		s[0] = 1;
		s[1] = 1;

		int i;
		for(i = 2; i < len; i++)
			s[i] = (s[i - 1] + s[i - 2]) % mod;

		int[] a = new int[m];

		for(i = 0; i < m; i++) {
			a[i] = scan.nextInt();
			if(i != 0) {
				if(a[i] - a[i - 1] == 1) {
					System.out.println(0);
					return;
				}
			}
		}
		if(m == 0) {
			System.out.println(s[n]);
		}else {

			int start;
			int end;
			long ans = 1;
			for(i = 0; i < m; i++) {
				if(i == 0) {
					start = 0;
					end = a[i] - 1;
				}else {
					start = a[i - 1] + 1;
					end = a[i] - 1;
				}
				ans = (ans * s[end - start]) % mod;
			}
			ans = (ans * s[n - (a[m - 1] + 1)]) % mod;
			System.out.println(ans);
		}


	}
}
