
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();
		int[] A = new int[M];
		for(int i = 0 ; i < M ; i++){
			A[i] = sc.nextInt();
		}
		sc.close();

		long INF = 1000000007;
		long[] dp = new long[N+1];

		dp[0] = 1;
		dp[1] = 1;

		for(int i = 0 ; i < M ;i++){
			dp[A[i]] = -1;
		}

		for(int j =2 ; j <= N ; j++){
			if(dp[j] != -1 && dp[j-1]!=-1 && dp[j-2] != -1){
				dp[j] = (dp[j-1] + dp[j-2])%INF;
			}
			else if(dp[j] != -1 && dp[j-1] == -1){
				dp[j] = (dp[j-2]);
			}
			else if(dp[j] != -1 && dp[j-2] == -1){
				dp[j] = (dp[j-1]);
			}
			//System.out.println(dp[j]);

		}
			if(dp[N] == -1){
				System.out.println("0");
			}
			else{
				System.out.println(dp[N]%INF);
			}

	}
} 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();
		int[] A = new int[M];
		for(int i = 0 ; i < M ; i++){
			A[i] = sc.nextInt();
		}
		sc.close();

		long INF = 1000000007;
		long[] dp = new long[N+1];

		dp[0] = 1;
		dp[1] = 1;

		for(int i = 0 ; i < M ;i++){
			dp[A[i]] = -1;
		}

		for(int j =2 ; j <= N ; j++){
			if(dp[j] != -1 && dp[j-1]!=-1 && dp[j-2] != -1){
				dp[j] = (dp[j-1] + dp[j-2])%INF;
			}
			else if(dp[j] != -1 && dp[j-1] == -1){
				dp[j] = (dp[j-2]);
			}
			else if(dp[j] != -1 && dp[j-2] == -1){
				dp[j] = (dp[j-1]);
			}
			//System.out.println(dp[j]);

		}
			if(dp[N] == -1){
				System.out.println("0");
			}
			else{
				System.out.println(dp[N]%INF);
			}

	}
} Main 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];
		for(int i = 0 ; i < M ; i++){
			A[i] = sc.nextInt();
		}
		sc.close();

		long INF = 1000000007;
		long[] dp = new long[N+1];

		dp[0] = 1;
		dp[1] = 1;

		for(int i = 0 ; i < M ;i++){
			dp[A[i]] = -1;
		}

		for(int j =2 ; j <= N ; j++){
			if(dp[j] != -1 && dp[j-1]!=-1 && dp[j-2] != -1){
				dp[j] = (dp[j-1] + dp[j-2])%INF;
			}
			else if(dp[j] != -1 && dp[j-1] == -1){
				dp[j] = (dp[j-2]);
			}
			else if(dp[j] != -1 && dp[j-2] == -1){
				dp[j] = (dp[j-1]);
			}
			//System.out.println(dp[j]);

		}
			if(dp[N] == -1){
				System.out.println("0");
			}
			else{
				System.out.println(dp[N]%INF);
			}

	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int[] A = new int[M];
		for(int i = 0 ; i < M ; i++){
			A[i] = sc.nextInt();
		}
		sc.close();

		long INF = 1000000007;
		long[] dp = new long[N+1];

		dp[0] = 1;
		dp[1] = 1;

		for(int i = 0 ; i < M ;i++){
			dp[A[i]] = -1;
		}

		for(int j =2 ; j <= N ; j++){
			if(dp[j] != -1 && dp[j-1]!=-1 && dp[j-2] != -1){
				dp[j] = (dp[j-1] + dp[j-2])%INF;
			}
			else if(dp[j] != -1 && dp[j-1] == -1){
				dp[j] = (dp[j-2]);
			}
			else if(dp[j] != -1 && dp[j-2] == -1){
				dp[j] = (dp[j-1]);
			}
			//System.out.println(dp[j]);

		}
			if(dp[N] == -1){
				System.out.println("0");
			}
			else{
				System.out.println(dp[N]%INF);
			}

	} 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]; A new int[M] M for(int i = 0 ; i < M ; i++){
			A[i] = sc.nextInt();
		} int i = 0 ; int i = 0 ; i 0 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 sc.close() sc.close sc long INF = 1000000007; INF 1000000007 long[] dp = new long[N+1]; dp new long[N+1] N+1 N 1 dp[0] = 1 dp[0] dp 0 1 dp[1] = 1 dp[1] dp 1 1 for(int i = 0 ; i < M ;i++){
			dp[A[i]] = -1;
		} int i = 0 ; int i = 0 ; i 0 i < M i M i++ i++ i {
			dp[A[i]] = -1;
		} {
			dp[A[i]] = -1;
		} dp[A[i]] = -1 dp[A[i]] dp A[i] A i -1 1 for(int j =2 ; j <= N ; j++){
			if(dp[j] != -1 && dp[j-1]!=-1 && dp[j-2] != -1){
				dp[j] = (dp[j-1] + dp[j-2])%INF;
			}
			else if(dp[j] != -1 && dp[j-1] == -1){
				dp[j] = (dp[j-2]);
			}
			else if(dp[j] != -1 && dp[j-2] == -1){
				dp[j] = (dp[j-1]);
			}
			//System.out.println(dp[j]);

		} int j =2 ; int j =2 ; j 2 j <= N j N j++ j++ j {
			if(dp[j] != -1 && dp[j-1]!=-1 && dp[j-2] != -1){
				dp[j] = (dp[j-1] + dp[j-2])%INF;
			}
			else if(dp[j] != -1 && dp[j-1] == -1){
				dp[j] = (dp[j-2]);
			}
			else if(dp[j] != -1 && dp[j-2] == -1){
				dp[j] = (dp[j-1]);
			}
			//System.out.println(dp[j]);

		} {
			if(dp[j] != -1 && dp[j-1]!=-1 && dp[j-2] != -1){
				dp[j] = (dp[j-1] + dp[j-2])%INF;
			}
			else if(dp[j] != -1 && dp[j-1] == -1){
				dp[j] = (dp[j-2]);
			}
			else if(dp[j] != -1 && dp[j-2] == -1){
				dp[j] = (dp[j-1]);
			}
			//System.out.println(dp[j]);

		} if(dp[j] != -1 && dp[j-1]!=-1 && dp[j-2] != -1){
				dp[j] = (dp[j-1] + dp[j-2])%INF;
			}
			else if(dp[j] != -1 && dp[j-1] == -1){
				dp[j] = (dp[j-2]);
			}
			else if(dp[j] != -1 && dp[j-2] == -1){
				dp[j] = (dp[j-1]);
			} dp[j] != -1 && dp[j-1]!=-1 && dp[j-2] != -1 dp[j] != -1 && dp[j-1]!=-1 && dp[j-2] != -1 dp[j] != -1 dp[j] dp j -1 1 dp[j-1]!=-1 dp[j-1] dp j-1 j 1 -1 1 dp[j-2] != -1 dp[j-2] dp j-2 j 2 -1 1 {
				dp[j] = (dp[j-1] + dp[j-2])%INF;
			} dp[j] = (dp[j-1] + dp[j-2])%INF dp[j] dp j (dp[j-1] + dp[j-2])%INF (dp[j-1] + dp[j-2]) dp[j-1] dp j-1 j 1 dp[j-2] dp j-2 j 2 INF if(dp[j] != -1 && dp[j-1] == -1){
				dp[j] = (dp[j-2]);
			}
			else if(dp[j] != -1 && dp[j-2] == -1){
				dp[j] = (dp[j-1]);
			} dp[j] != -1 && dp[j-1] == -1 dp[j] != -1 dp[j] dp j -1 1 dp[j-1] == -1 dp[j-1] dp j-1 j 1 -1 1 {
				dp[j] = (dp[j-2]);
			} dp[j] = (dp[j-2]) dp[j] dp j (dp[j-2]) dp j-2 j 2 if(dp[j] != -1 && dp[j-2] == -1){
				dp[j] = (dp[j-1]);
			} dp[j] != -1 && dp[j-2] == -1 dp[j] != -1 dp[j] dp j -1 1 dp[j-2] == -1 dp[j-2] dp j-2 j 2 -1 1 {
				dp[j] = (dp[j-1]);
			} dp[j] = (dp[j-1]) dp[j] dp j (dp[j-1]) dp j-1 j 1 if(dp[N] == -1){
				System.out.println("0");
			}
			else{
				System.out.println(dp[N]%INF);
			} dp[N] == -1 dp[N] dp N -1 1 {
				System.out.println("0");
			} System.out.println("0") System.out.println System.out System System.out "0" {
				System.out.println(dp[N]%INF);
			} System.out.println(dp[N]%INF) System.out.println System.out System System.out dp[N]%INF dp[N] dp N INF 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();
		int[] A = new int[M];
		for(int i = 0 ; i < M ; i++){
			A[i] = sc.nextInt();
		}
		sc.close();

		long INF = 1000000007;
		long[] dp = new long[N+1];

		dp[0] = 1;
		dp[1] = 1;

		for(int i = 0 ; i < M ;i++){
			dp[A[i]] = -1;
		}

		for(int j =2 ; j <= N ; j++){
			if(dp[j] != -1 && dp[j-1]!=-1 && dp[j-2] != -1){
				dp[j] = (dp[j-1] + dp[j-2])%INF;
			}
			else if(dp[j] != -1 && dp[j-1] == -1){
				dp[j] = (dp[j-2]);
			}
			else if(dp[j] != -1 && dp[j-2] == -1){
				dp[j] = (dp[j-1]);
			}
			//System.out.println(dp[j]);

		}
			if(dp[N] == -1){
				System.out.println("0");
			}
			else{
				System.out.println(dp[N]%INF);
			}

	}
} public class Main {

	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];
		for(int i = 0 ; i < M ; i++){
			A[i] = sc.nextInt();
		}
		sc.close();

		long INF = 1000000007;
		long[] dp = new long[N+1];

		dp[0] = 1;
		dp[1] = 1;

		for(int i = 0 ; i < M ;i++){
			dp[A[i]] = -1;
		}

		for(int j =2 ; j <= N ; j++){
			if(dp[j] != -1 && dp[j-1]!=-1 && dp[j-2] != -1){
				dp[j] = (dp[j-1] + dp[j-2])%INF;
			}
			else if(dp[j] != -1 && dp[j-1] == -1){
				dp[j] = (dp[j-2]);
			}
			else if(dp[j] != -1 && dp[j-2] == -1){
				dp[j] = (dp[j-1]);
			}
			//System.out.println(dp[j]);

		}
			if(dp[N] == -1){
				System.out.println("0");
			}
			else{
				System.out.println(dp[N]%INF);
			}

	}
} 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();
		int[] A = new int[M];
		for(int i = 0 ; i < M ; i++){
			A[i] = sc.nextInt();
		}
		sc.close();

		long INF = 1000000007;
		long[] dp = new long[N+1];

		dp[0] = 1;
		dp[1] = 1;

		for(int i = 0 ; i < M ;i++){
			dp[A[i]] = -1;
		}

		for(int j =2 ; j <= N ; j++){
			if(dp[j] != -1 && dp[j-1]!=-1 && dp[j-2] != -1){
				dp[j] = (dp[j-1] + dp[j-2])%INF;
			}
			else if(dp[j] != -1 && dp[j-1] == -1){
				dp[j] = (dp[j-2]);
			}
			else if(dp[j] != -1 && dp[j-2] == -1){
				dp[j] = (dp[j-1]);
			}
			//System.out.println(dp[j]);

		}
			if(dp[N] == -1){
				System.out.println("0");
			}
			else{
				System.out.println(dp[N]%INF);
			}

	}
}
