import java.util.*;
import java.lang.*;

public class Main {
	static long MOD = 1000000007;
	static long[] count;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] a = new int[m + 2];
		a[0] = -1;
		for (int i = 1; i <= m; i++) {
			a[i] = sc.nextInt();
		}
		a[m + 1] = n + 1;
		long sum = 1;
		count = new long[n + 2];
		for (int i = 0; i < n; i++) {
			count[i] = -1;
		}
		count[0] = 0;
		count[1] = 1;
		for (int i = 2; i < n + 2; i++) {
			count[i] = (count[i - 1] % MOD + count[i - 2] % MOD) % MOD;
		}
		for (int i = 1; i < m + 2; i++) {
			int step = a[i] - a[i - 1] - 1;
			sum *= count[step];
			sum %= MOD;
		}
		System.out.println(sum);
	}
} import java.util.*; util.* java import java.lang.*; lang.* java public class Main {
	static long MOD = 1000000007;
	static long[] count;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] a = new int[m + 2];
		a[0] = -1;
		for (int i = 1; i <= m; i++) {
			a[i] = sc.nextInt();
		}
		a[m + 1] = n + 1;
		long sum = 1;
		count = new long[n + 2];
		for (int i = 0; i < n; i++) {
			count[i] = -1;
		}
		count[0] = 0;
		count[1] = 1;
		for (int i = 2; i < n + 2; i++) {
			count[i] = (count[i - 1] % MOD + count[i - 2] % MOD) % MOD;
		}
		for (int i = 1; i < m + 2; i++) {
			int step = a[i] - a[i - 1] - 1;
			sum *= count[step];
			sum %= MOD;
		}
		System.out.println(sum);
	}
} Main static long MOD = 1000000007; MOD 1000000007 static long[] count; count public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] a = new int[m + 2];
		a[0] = -1;
		for (int i = 1; i <= m; i++) {
			a[i] = sc.nextInt();
		}
		a[m + 1] = n + 1;
		long sum = 1;
		count = new long[n + 2];
		for (int i = 0; i < n; i++) {
			count[i] = -1;
		}
		count[0] = 0;
		count[1] = 1;
		for (int i = 2; i < n + 2; i++) {
			count[i] = (count[i - 1] % MOD + count[i - 2] % MOD) % MOD;
		}
		for (int i = 1; i < m + 2; i++) {
			int step = a[i] - a[i - 1] - 1;
			sum *= count[step];
			sum %= MOD;
		}
		System.out.println(sum);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] a = new int[m + 2];
		a[0] = -1;
		for (int i = 1; i <= m; i++) {
			a[i] = sc.nextInt();
		}
		a[m + 1] = n + 1;
		long sum = 1;
		count = new long[n + 2];
		for (int i = 0; i < n; i++) {
			count[i] = -1;
		}
		count[0] = 0;
		count[1] = 1;
		for (int i = 2; i < n + 2; i++) {
			count[i] = (count[i - 1] % MOD + count[i - 2] % MOD) % MOD;
		}
		for (int i = 1; i < m + 2; i++) {
			int step = a[i] - a[i - 1] - 1;
			sum *= count[step];
			sum %= MOD;
		}
		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 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 (int i = 1; i <= m; i++) {
			a[i] = sc.nextInt();
		} int i = 1; int i = 1; i 1 i <= m i m i++ i++ i {
			a[i] = sc.nextInt();
		} {
			a[i] = sc.nextInt();
		} a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc a[m + 1] = n + 1 a[m + 1] a m + 1 m 1 n + 1 n 1 long sum = 1; sum 1 count = new long[n + 2] count new long[n + 2] n + 2 n 2 for (int i = 0; i < n; i++) {
			count[i] = -1;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			count[i] = -1;
		} {
			count[i] = -1;
		} count[i] = -1 count[i] count i -1 1 count[0] = 0 count[0] count 0 0 count[1] = 1 count[1] count 1 1 for (int i = 2; i < n + 2; i++) {
			count[i] = (count[i - 1] % MOD + count[i - 2] % MOD) % MOD;
		} int i = 2; int i = 2; i 2 i < n + 2 i n + 2 n 2 i++ i++ i {
			count[i] = (count[i - 1] % MOD + count[i - 2] % MOD) % MOD;
		} {
			count[i] = (count[i - 1] % MOD + count[i - 2] % MOD) % MOD;
		} count[i] = (count[i - 1] % MOD + count[i - 2] % MOD) % MOD count[i] count i (count[i - 1] % MOD + count[i - 2] % MOD) % MOD (count[i - 1] % MOD + count[i - 2] % MOD) count[i - 1] % MOD count[i - 1] count i - 1 i 1 MOD count[i - 2] % MOD count[i - 2] count i - 2 i 2 MOD MOD for (int i = 1; i < m + 2; i++) {
			int step = a[i] - a[i - 1] - 1;
			sum *= count[step];
			sum %= MOD;
		} int i = 1; int i = 1; i 1 i < m + 2 i m + 2 m 2 i++ i++ i {
			int step = a[i] - a[i - 1] - 1;
			sum *= count[step];
			sum %= MOD;
		} {
			int step = a[i] - a[i - 1] - 1;
			sum *= count[step];
			sum %= MOD;
		} int step = a[i] - a[i - 1] - 1; step 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 sum *= count[step] sum count[step] count step sum %= MOD sum MOD System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
	static long MOD = 1000000007;
	static long[] count;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] a = new int[m + 2];
		a[0] = -1;
		for (int i = 1; i <= m; i++) {
			a[i] = sc.nextInt();
		}
		a[m + 1] = n + 1;
		long sum = 1;
		count = new long[n + 2];
		for (int i = 0; i < n; i++) {
			count[i] = -1;
		}
		count[0] = 0;
		count[1] = 1;
		for (int i = 2; i < n + 2; i++) {
			count[i] = (count[i - 1] % MOD + count[i - 2] % MOD) % MOD;
		}
		for (int i = 1; i < m + 2; i++) {
			int step = a[i] - a[i - 1] - 1;
			sum *= count[step];
			sum %= MOD;
		}
		System.out.println(sum);
	}
} public class Main {
	static long MOD = 1000000007;
	static long[] count;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] a = new int[m + 2];
		a[0] = -1;
		for (int i = 1; i <= m; i++) {
			a[i] = sc.nextInt();
		}
		a[m + 1] = n + 1;
		long sum = 1;
		count = new long[n + 2];
		for (int i = 0; i < n; i++) {
			count[i] = -1;
		}
		count[0] = 0;
		count[1] = 1;
		for (int i = 2; i < n + 2; i++) {
			count[i] = (count[i - 1] % MOD + count[i - 2] % MOD) % MOD;
		}
		for (int i = 1; i < m + 2; i++) {
			int step = a[i] - a[i - 1] - 1;
			sum *= count[step];
			sum %= MOD;
		}
		System.out.println(sum);
	}
} Main
import java.util.*;
import java.lang.*;

public class Main {
	static long MOD = 1000000007;
	static long[] count;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] a = new int[m + 2];
		a[0] = -1;
		for (int i = 1; i <= m; i++) {
			a[i] = sc.nextInt();
		}
		a[m + 1] = n + 1;
		long sum = 1;
		count = new long[n + 2];
		for (int i = 0; i < n; i++) {
			count[i] = -1;
		}
		count[0] = 0;
		count[1] = 1;
		for (int i = 2; i < n + 2; i++) {
			count[i] = (count[i - 1] % MOD + count[i - 2] % MOD) % MOD;
		}
		for (int i = 1; i < m + 2; i++) {
			int step = a[i] - a[i - 1] - 1;
			sum *= count[step];
			sum %= MOD;
		}
		System.out.println(sum);
	}
}
