
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		int M = scn.nextInt();
		int[] A = new int[M+1];
		long[] fib = new long[N + 1];
		final long MOD = 1000000007;
		long ans = 1;
		boolean can = true;
		for (int i = 0; i < M; i++) {
			A[i] = scn.nextInt();
			if (i != 0 && A[i] - A[i - 1] == 1)
				can = false;
		}
		A[M] = N+1;
		if (can) {
			fib[1] = 1;
			fib[0] = 1;
			for (int i = 2; i <= N; i++) {
				fib[i] = fib[i - 1] + fib[i - 2];
				fib[i] %= MOD;
			}
			int b = 0;

			for (int i = 0; i < M+1; i++) {
				int a = A[i];
				ans *= fib[a - b-1];
				ans %= MOD;
				b = a+1;
			}
		} else {
			ans = 0;
		}
		System.out.println(ans);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		int M = scn.nextInt();
		int[] A = new int[M+1];
		long[] fib = new long[N + 1];
		final long MOD = 1000000007;
		long ans = 1;
		boolean can = true;
		for (int i = 0; i < M; i++) {
			A[i] = scn.nextInt();
			if (i != 0 && A[i] - A[i - 1] == 1)
				can = false;
		}
		A[M] = N+1;
		if (can) {
			fib[1] = 1;
			fib[0] = 1;
			for (int i = 2; i <= N; i++) {
				fib[i] = fib[i - 1] + fib[i - 2];
				fib[i] %= MOD;
			}
			int b = 0;

			for (int i = 0; i < M+1; i++) {
				int a = A[i];
				ans *= fib[a - b-1];
				ans %= MOD;
				b = a+1;
			}
		} else {
			ans = 0;
		}
		System.out.println(ans);
	}

} Main public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		int M = scn.nextInt();
		int[] A = new int[M+1];
		long[] fib = new long[N + 1];
		final long MOD = 1000000007;
		long ans = 1;
		boolean can = true;
		for (int i = 0; i < M; i++) {
			A[i] = scn.nextInt();
			if (i != 0 && A[i] - A[i - 1] == 1)
				can = false;
		}
		A[M] = N+1;
		if (can) {
			fib[1] = 1;
			fib[0] = 1;
			for (int i = 2; i <= N; i++) {
				fib[i] = fib[i - 1] + fib[i - 2];
				fib[i] %= MOD;
			}
			int b = 0;

			for (int i = 0; i < M+1; i++) {
				int a = A[i];
				ans *= fib[a - b-1];
				ans %= MOD;
				b = a+1;
			}
		} else {
			ans = 0;
		}
		System.out.println(ans);
	} main {
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		int M = scn.nextInt();
		int[] A = new int[M+1];
		long[] fib = new long[N + 1];
		final long MOD = 1000000007;
		long ans = 1;
		boolean can = true;
		for (int i = 0; i < M; i++) {
			A[i] = scn.nextInt();
			if (i != 0 && A[i] - A[i - 1] == 1)
				can = false;
		}
		A[M] = N+1;
		if (can) {
			fib[1] = 1;
			fib[0] = 1;
			for (int i = 2; i <= N; i++) {
				fib[i] = fib[i - 1] + fib[i - 2];
				fib[i] %= MOD;
			}
			int b = 0;

			for (int i = 0; i < M+1; i++) {
				int a = A[i];
				ans *= fib[a - b-1];
				ans %= MOD;
				b = a+1;
			}
		} else {
			ans = 0;
		}
		System.out.println(ans);
	} Scanner scn = new Scanner(System.in); scn new Scanner(System.in) int N = scn.nextInt(); N scn.nextInt() scn.nextInt scn int M = scn.nextInt(); M scn.nextInt() scn.nextInt scn int[] A = new int[M+1]; A new int[M+1] M+1 M 1 long[] fib = new long[N + 1]; fib new long[N + 1] N + 1 N 1 final long MOD = 1000000007; MOD 1000000007 long ans = 1; ans 1 boolean can = true; can true for (int i = 0; i < M; i++) {
			A[i] = scn.nextInt();
			if (i != 0 && A[i] - A[i - 1] == 1)
				can = false;
		} int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
			A[i] = scn.nextInt();
			if (i != 0 && A[i] - A[i - 1] == 1)
				can = false;
		} {
			A[i] = scn.nextInt();
			if (i != 0 && A[i] - A[i - 1] == 1)
				can = false;
		} A[i] = scn.nextInt() A[i] A i scn.nextInt() scn.nextInt scn if (i != 0 && A[i] - A[i - 1] == 1)
				can = false; i != 0 && A[i] - A[i - 1] == 1 i != 0 i 0 A[i] - A[i - 1] == 1 A[i] - A[i - 1] A[i] A i A[i - 1] A i - 1 i 1 1 can = false can false A[M] = N+1 A[M] A M N+1 N 1 if (can) {
			fib[1] = 1;
			fib[0] = 1;
			for (int i = 2; i <= N; i++) {
				fib[i] = fib[i - 1] + fib[i - 2];
				fib[i] %= MOD;
			}
			int b = 0;

			for (int i = 0; i < M+1; i++) {
				int a = A[i];
				ans *= fib[a - b-1];
				ans %= MOD;
				b = a+1;
			}
		} else {
			ans = 0;
		} can {
			fib[1] = 1;
			fib[0] = 1;
			for (int i = 2; i <= N; i++) {
				fib[i] = fib[i - 1] + fib[i - 2];
				fib[i] %= MOD;
			}
			int b = 0;

			for (int i = 0; i < M+1; i++) {
				int a = A[i];
				ans *= fib[a - b-1];
				ans %= MOD;
				b = a+1;
			}
		} fib[1] = 1 fib[1] fib 1 1 fib[0] = 1 fib[0] fib 0 1 for (int i = 2; i <= N; i++) {
				fib[i] = fib[i - 1] + fib[i - 2];
				fib[i] %= MOD;
			} int i = 2; int i = 2; i 2 i <= N i N i++ i++ i {
				fib[i] = fib[i - 1] + fib[i - 2];
				fib[i] %= MOD;
			} {
				fib[i] = fib[i - 1] + fib[i - 2];
				fib[i] %= MOD;
			} 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] %= MOD fib[i] fib i MOD int b = 0; b 0 for (int i = 0; i < M+1; i++) {
				int a = A[i];
				ans *= fib[a - b-1];
				ans %= MOD;
				b = a+1;
			} int i = 0; int i = 0; i 0 i < M+1 i M+1 M 1 i++ i++ i {
				int a = A[i];
				ans *= fib[a - b-1];
				ans %= MOD;
				b = a+1;
			} {
				int a = A[i];
				ans *= fib[a - b-1];
				ans %= MOD;
				b = a+1;
			} int a = A[i]; a A[i] A i ans *= fib[a - b-1] ans fib[a - b-1] fib a - b-1 a - b-1 a b 1 ans %= MOD ans MOD b = a+1 b a+1 a 1 {
			ans = 0;
		} ans = 0 ans 0 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 scn = new Scanner(System.in);
		int N = scn.nextInt();
		int M = scn.nextInt();
		int[] A = new int[M+1];
		long[] fib = new long[N + 1];
		final long MOD = 1000000007;
		long ans = 1;
		boolean can = true;
		for (int i = 0; i < M; i++) {
			A[i] = scn.nextInt();
			if (i != 0 && A[i] - A[i - 1] == 1)
				can = false;
		}
		A[M] = N+1;
		if (can) {
			fib[1] = 1;
			fib[0] = 1;
			for (int i = 2; i <= N; i++) {
				fib[i] = fib[i - 1] + fib[i - 2];
				fib[i] %= MOD;
			}
			int b = 0;

			for (int i = 0; i < M+1; i++) {
				int a = A[i];
				ans *= fib[a - b-1];
				ans %= MOD;
				b = a+1;
			}
		} else {
			ans = 0;
		}
		System.out.println(ans);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		int M = scn.nextInt();
		int[] A = new int[M+1];
		long[] fib = new long[N + 1];
		final long MOD = 1000000007;
		long ans = 1;
		boolean can = true;
		for (int i = 0; i < M; i++) {
			A[i] = scn.nextInt();
			if (i != 0 && A[i] - A[i - 1] == 1)
				can = false;
		}
		A[M] = N+1;
		if (can) {
			fib[1] = 1;
			fib[0] = 1;
			for (int i = 2; i <= N; i++) {
				fib[i] = fib[i - 1] + fib[i - 2];
				fib[i] %= MOD;
			}
			int b = 0;

			for (int i = 0; i < M+1; i++) {
				int a = A[i];
				ans *= fib[a - b-1];
				ans %= MOD;
				b = a+1;
			}
		} else {
			ans = 0;
		}
		System.out.println(ans);
	}

} Main

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		int M = scn.nextInt();
		int[] A = new int[M+1];
		long[] fib = new long[N + 1];
		final long MOD = 1000000007;
		long ans = 1;
		boolean can = true;
		for (int i = 0; i < M; i++) {
			A[i] = scn.nextInt();
			if (i != 0 && A[i] - A[i - 1] == 1)
				can = false;
		}
		A[M] = N+1;
		if (can) {
			fib[1] = 1;
			fib[0] = 1;
			for (int i = 2; i <= N; i++) {
				fib[i] = fib[i - 1] + fib[i - 2];
				fib[i] %= MOD;
			}
			int b = 0;

			for (int i = 0; i < M+1; i++) {
				int a = A[i];
				ans *= fib[a - b-1];
				ans %= MOD;
				b = a+1;
			}
		} else {
			ans = 0;
		}
		System.out.println(ans);
	}

}
