import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		final long D = 1000000007;
		long result = 1;

		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int M = in.nextInt();

		// 壊れ段 スタート直前とゴール直後も登録しておく
		int[] a = new int[M + 2];
		a[0] = -1;
		a[M + 1] = N + 1;

		long[] ptrns = new long[M + 2];
		for ( int i = 1; i <= M; i++ ) {
			a[i] = in.nextInt();
			ptrns[i] = getStepPatterns(a[i] - a[i - 1] - 1);
		}
		ptrns[M + 1] = getStepPatterns(a[M + 1] - a[M] - 1);

		for ( int i = 1; i <= M + 1; i++ ) {
			result = (result * (ptrns[i]) % D) % D;
		}

		System.out.println(result);
		in.close();
	}

	// n段のステップパターンを計算する（nにはスタートとゴールの段を含む）
	private static long getStepPatterns(int ｎ) {
		long D = 1000000007;
		long ptrn = 0;

		if ( ｎ <= 0 ) ptrn = 0;
		else if ( ｎ == 1 || ｎ == 2 ) ptrn = 1;
		else
		// (p+2)段目のパターン = (p+1)段目のパターン + p段目のパターン
		if ( 3 <= ｎ ) {
			long p0, p1, p2;
			p0 = p1 = p2 = 1;

			for ( int i = 2; i < ｎ; i++ ) {
				p2 = (p1 + p0) % D;
				p0 = p1;
				p1 = p2;
			}
			ptrn = p2;
		}
		return ptrn;
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		final long D = 1000000007;
		long result = 1;

		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int M = in.nextInt();

		// 壊れ段 スタート直前とゴール直後も登録しておく
		int[] a = new int[M + 2];
		a[0] = -1;
		a[M + 1] = N + 1;

		long[] ptrns = new long[M + 2];
		for ( int i = 1; i <= M; i++ ) {
			a[i] = in.nextInt();
			ptrns[i] = getStepPatterns(a[i] - a[i - 1] - 1);
		}
		ptrns[M + 1] = getStepPatterns(a[M + 1] - a[M] - 1);

		for ( int i = 1; i <= M + 1; i++ ) {
			result = (result * (ptrns[i]) % D) % D;
		}

		System.out.println(result);
		in.close();
	}

	// n段のステップパターンを計算する（nにはスタートとゴールの段を含む）
	private static long getStepPatterns(int ｎ) {
		long D = 1000000007;
		long ptrn = 0;

		if ( ｎ <= 0 ) ptrn = 0;
		else if ( ｎ == 1 || ｎ == 2 ) ptrn = 1;
		else
		// (p+2)段目のパターン = (p+1)段目のパターン + p段目のパターン
		if ( 3 <= ｎ ) {
			long p0, p1, p2;
			p0 = p1 = p2 = 1;

			for ( int i = 2; i < ｎ; i++ ) {
				p2 = (p1 + p0) % D;
				p0 = p1;
				p1 = p2;
			}
			ptrn = p2;
		}
		return ptrn;
	}
} Main public static void main(String[] args) {
		final long D = 1000000007;
		long result = 1;

		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int M = in.nextInt();

		// 壊れ段 スタート直前とゴール直後も登録しておく
		int[] a = new int[M + 2];
		a[0] = -1;
		a[M + 1] = N + 1;

		long[] ptrns = new long[M + 2];
		for ( int i = 1; i <= M; i++ ) {
			a[i] = in.nextInt();
			ptrns[i] = getStepPatterns(a[i] - a[i - 1] - 1);
		}
		ptrns[M + 1] = getStepPatterns(a[M + 1] - a[M] - 1);

		for ( int i = 1; i <= M + 1; i++ ) {
			result = (result * (ptrns[i]) % D) % D;
		}

		System.out.println(result);
		in.close();
	} main {
		final long D = 1000000007;
		long result = 1;

		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int M = in.nextInt();

		// 壊れ段 スタート直前とゴール直後も登録しておく
		int[] a = new int[M + 2];
		a[0] = -1;
		a[M + 1] = N + 1;

		long[] ptrns = new long[M + 2];
		for ( int i = 1; i <= M; i++ ) {
			a[i] = in.nextInt();
			ptrns[i] = getStepPatterns(a[i] - a[i - 1] - 1);
		}
		ptrns[M + 1] = getStepPatterns(a[M + 1] - a[M] - 1);

		for ( int i = 1; i <= M + 1; i++ ) {
			result = (result * (ptrns[i]) % D) % D;
		}

		System.out.println(result);
		in.close();
	} final long D = 1000000007; D 1000000007 long result = 1; result 1 Scanner in = new Scanner(System.in); in new Scanner(System.in) int N = in.nextInt(); N in.nextInt() in.nextInt in int M = in.nextInt(); M in.nextInt() in.nextInt in int[] a = new int[M + 2]; a new int[M + 2] M + 2 M 2 a[0] = -1 a[0] a 0 -1 1 a[M + 1] = N + 1 a[M + 1] a M + 1 M 1 N + 1 N 1 long[] ptrns = new long[M + 2]; ptrns new long[M + 2] M + 2 M 2 for ( int i = 1; i <= M; i++ ) {
			a[i] = in.nextInt();
			ptrns[i] = getStepPatterns(a[i] - a[i - 1] - 1);
		} int i = 1; int i = 1; i 1 i <= M i M i++ i++ i {
			a[i] = in.nextInt();
			ptrns[i] = getStepPatterns(a[i] - a[i - 1] - 1);
		} {
			a[i] = in.nextInt();
			ptrns[i] = getStepPatterns(a[i] - a[i - 1] - 1);
		} a[i] = in.nextInt() a[i] a i in.nextInt() in.nextInt in ptrns[i] = getStepPatterns(a[i] - a[i - 1] - 1) ptrns[i] ptrns i getStepPatterns(a[i] - a[i - 1] - 1) getStepPatterns a[i] - a[i - 1] - 1 a[i] - a[i - 1] - 1 a[i] a i a[i - 1] a i - 1 i 1 1 ptrns[M + 1] = getStepPatterns(a[M + 1] - a[M] - 1) ptrns[M + 1] ptrns M + 1 M 1 getStepPatterns(a[M + 1] - a[M] - 1) getStepPatterns a[M + 1] - a[M] - 1 a[M + 1] - a[M] - 1 a[M + 1] a M + 1 M 1 a[M] a M 1 for ( int i = 1; i <= M + 1; i++ ) {
			result = (result * (ptrns[i]) % D) % D;
		} int i = 1; int i = 1; i 1 i <= M + 1 i M + 1 M 1 i++ i++ i {
			result = (result * (ptrns[i]) % D) % D;
		} {
			result = (result * (ptrns[i]) % D) % D;
		} result = (result * (ptrns[i]) % D) % D result (result * (ptrns[i]) % D) % D (result * (ptrns[i]) % D) result * (ptrns[i]) result (ptrns[i]) ptrns i D D System.out.println(result) System.out.println System.out System System.out result in.close() in.close in String[] args args // n段のステップパターンを計算する（nにはスタートとゴールの段を含む）
	private static long getStepPatterns(int ｎ) {
		long D = 1000000007;
		long ptrn = 0;

		if ( ｎ <= 0 ) ptrn = 0;
		else if ( ｎ == 1 || ｎ == 2 ) ptrn = 1;
		else
		// (p+2)段目のパターン = (p+1)段目のパターン + p段目のパターン
		if ( 3 <= ｎ ) {
			long p0, p1, p2;
			p0 = p1 = p2 = 1;

			for ( int i = 2; i < ｎ; i++ ) {
				p2 = (p1 + p0) % D;
				p0 = p1;
				p1 = p2;
			}
			ptrn = p2;
		}
		return ptrn;
	} getStepPatterns {
		long D = 1000000007;
		long ptrn = 0;

		if ( ｎ <= 0 ) ptrn = 0;
		else if ( ｎ == 1 || ｎ == 2 ) ptrn = 1;
		else
		// (p+2)段目のパターン = (p+1)段目のパターン + p段目のパターン
		if ( 3 <= ｎ ) {
			long p0, p1, p2;
			p0 = p1 = p2 = 1;

			for ( int i = 2; i < ｎ; i++ ) {
				p2 = (p1 + p0) % D;
				p0 = p1;
				p1 = p2;
			}
			ptrn = p2;
		}
		return ptrn;
	} long D = 1000000007; D 1000000007 long ptrn = 0; ptrn 0 if ( ｎ <= 0 ) ptrn = 0;
		else if ( ｎ == 1 || ｎ == 2 ) ptrn = 1;
		else
		// (p+2)段目のパターン = (p+1)段目のパターン + p段目のパターン
		if ( 3 <= ｎ ) {
			long p0, p1, p2;
			p0 = p1 = p2 = 1;

			for ( int i = 2; i < ｎ; i++ ) {
				p2 = (p1 + p0) % D;
				p0 = p1;
				p1 = p2;
			}
			ptrn = p2;
		} ｎ <= 0 ｎ 0 ptrn = 0 ptrn 0 if ( ｎ == 1 || ｎ == 2 ) ptrn = 1;
		else
		// (p+2)段目のパターン = (p+1)段目のパターン + p段目のパターン
		if ( 3 <= ｎ ) {
			long p0, p1, p2;
			p0 = p1 = p2 = 1;

			for ( int i = 2; i < ｎ; i++ ) {
				p2 = (p1 + p0) % D;
				p0 = p1;
				p1 = p2;
			}
			ptrn = p2;
		} ｎ == 1 || ｎ == 2 ｎ == 1 ｎ 1 ｎ == 2 ｎ 2 ptrn = 1 ptrn 1 if ( 3 <= ｎ ) {
			long p0, p1, p2;
			p0 = p1 = p2 = 1;

			for ( int i = 2; i < ｎ; i++ ) {
				p2 = (p1 + p0) % D;
				p0 = p1;
				p1 = p2;
			}
			ptrn = p2;
		} 3 <= ｎ 3 ｎ {
			long p0, p1, p2;
			p0 = p1 = p2 = 1;

			for ( int i = 2; i < ｎ; i++ ) {
				p2 = (p1 + p0) % D;
				p0 = p1;
				p1 = p2;
			}
			ptrn = p2;
		} long p0 p0 p1 p1 p2; p2 p0 = p1 = p2 = 1 p0 p1 = p2 = 1 p1 p2 = 1 p2 1 for ( int i = 2; i < ｎ; i++ ) {
				p2 = (p1 + p0) % D;
				p0 = p1;
				p1 = p2;
			} int i = 2; int i = 2; i 2 i < ｎ i ｎ i++ i++ i {
				p2 = (p1 + p0) % D;
				p0 = p1;
				p1 = p2;
			} {
				p2 = (p1 + p0) % D;
				p0 = p1;
				p1 = p2;
			} p2 = (p1 + p0) % D p2 (p1 + p0) % D (p1 + p0) p1 p0 D p0 = p1 p0 p1 p1 = p2 p1 p2 ptrn = p2 ptrn p2 return ptrn; ptrn int ｎ ｎ public class Main {
	public static void main(String[] args) {
		final long D = 1000000007;
		long result = 1;

		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int M = in.nextInt();

		// 壊れ段 スタート直前とゴール直後も登録しておく
		int[] a = new int[M + 2];
		a[0] = -1;
		a[M + 1] = N + 1;

		long[] ptrns = new long[M + 2];
		for ( int i = 1; i <= M; i++ ) {
			a[i] = in.nextInt();
			ptrns[i] = getStepPatterns(a[i] - a[i - 1] - 1);
		}
		ptrns[M + 1] = getStepPatterns(a[M + 1] - a[M] - 1);

		for ( int i = 1; i <= M + 1; i++ ) {
			result = (result * (ptrns[i]) % D) % D;
		}

		System.out.println(result);
		in.close();
	}

	// n段のステップパターンを計算する（nにはスタートとゴールの段を含む）
	private static long getStepPatterns(int ｎ) {
		long D = 1000000007;
		long ptrn = 0;

		if ( ｎ <= 0 ) ptrn = 0;
		else if ( ｎ == 1 || ｎ == 2 ) ptrn = 1;
		else
		// (p+2)段目のパターン = (p+1)段目のパターン + p段目のパターン
		if ( 3 <= ｎ ) {
			long p0, p1, p2;
			p0 = p1 = p2 = 1;

			for ( int i = 2; i < ｎ; i++ ) {
				p2 = (p1 + p0) % D;
				p0 = p1;
				p1 = p2;
			}
			ptrn = p2;
		}
		return ptrn;
	}
} public class Main {
	public static void main(String[] args) {
		final long D = 1000000007;
		long result = 1;

		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int M = in.nextInt();

		// 壊れ段 スタート直前とゴール直後も登録しておく
		int[] a = new int[M + 2];
		a[0] = -1;
		a[M + 1] = N + 1;

		long[] ptrns = new long[M + 2];
		for ( int i = 1; i <= M; i++ ) {
			a[i] = in.nextInt();
			ptrns[i] = getStepPatterns(a[i] - a[i - 1] - 1);
		}
		ptrns[M + 1] = getStepPatterns(a[M + 1] - a[M] - 1);

		for ( int i = 1; i <= M + 1; i++ ) {
			result = (result * (ptrns[i]) % D) % D;
		}

		System.out.println(result);
		in.close();
	}

	// n段のステップパターンを計算する（nにはスタートとゴールの段を含む）
	private static long getStepPatterns(int ｎ) {
		long D = 1000000007;
		long ptrn = 0;

		if ( ｎ <= 0 ) ptrn = 0;
		else if ( ｎ == 1 || ｎ == 2 ) ptrn = 1;
		else
		// (p+2)段目のパターン = (p+1)段目のパターン + p段目のパターン
		if ( 3 <= ｎ ) {
			long p0, p1, p2;
			p0 = p1 = p2 = 1;

			for ( int i = 2; i < ｎ; i++ ) {
				p2 = (p1 + p0) % D;
				p0 = p1;
				p1 = p2;
			}
			ptrn = p2;
		}
		return ptrn;
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		final long D = 1000000007;
		long result = 1;

		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int M = in.nextInt();

		// 壊れ段 スタート直前とゴール直後も登録しておく
		int[] a = new int[M + 2];
		a[0] = -1;
		a[M + 1] = N + 1;

		long[] ptrns = new long[M + 2];
		for ( int i = 1; i <= M; i++ ) {
			a[i] = in.nextInt();
			ptrns[i] = getStepPatterns(a[i] - a[i - 1] - 1);
		}
		ptrns[M + 1] = getStepPatterns(a[M + 1] - a[M] - 1);

		for ( int i = 1; i <= M + 1; i++ ) {
			result = (result * (ptrns[i]) % D) % D;
		}

		System.out.println(result);
		in.close();
	}

	// n段のステップパターンを計算する（nにはスタートとゴールの段を含む）
	private static long getStepPatterns(int ｎ) {
		long D = 1000000007;
		long ptrn = 0;

		if ( ｎ <= 0 ) ptrn = 0;
		else if ( ｎ == 1 || ｎ == 2 ) ptrn = 1;
		else
		// (p+2)段目のパターン = (p+1)段目のパターン + p段目のパターン
		if ( 3 <= ｎ ) {
			long p0, p1, p2;
			p0 = p1 = p2 = 1;

			for ( int i = 2; i < ｎ; i++ ) {
				p2 = (p1 + p0) % D;
				p0 = p1;
				p1 = p2;
			}
			ptrn = p2;
		}
		return ptrn;
	}
}
