import java.util.Scanner;

class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        boolean[] a = new boolean[N];

        for (int i = 0; i < M; i++) {
            int n = sc.nextInt();
            a[n] = true;
        }

        int[] dp = new int[N+1];
        int b = 1000000007;
        for (int i = N; i >= 0; i--) {
            if (i == N) {
                dp[i] = 1;
                continue;
            }
            if (a[i]) {
                dp[i] = 0;
                continue;
            }
            if (i+2 > N) {
                dp[i] = dp[i+1]%b;
                continue;
            }
            dp[i] = (dp[i+1] + dp[i+2])%b;
        }
        System.out.println(dp[0]);
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        boolean[] a = new boolean[N];

        for (int i = 0; i < M; i++) {
            int n = sc.nextInt();
            a[n] = true;
        }

        int[] dp = new int[N+1];
        int b = 1000000007;
        for (int i = N; i >= 0; i--) {
            if (i == N) {
                dp[i] = 1;
                continue;
            }
            if (a[i]) {
                dp[i] = 0;
                continue;
            }
            if (i+2 > N) {
                dp[i] = dp[i+1]%b;
                continue;
            }
            dp[i] = (dp[i+1] + dp[i+2])%b;
        }
        System.out.println(dp[0]);
    }
} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        boolean[] a = new boolean[N];

        for (int i = 0; i < M; i++) {
            int n = sc.nextInt();
            a[n] = true;
        }

        int[] dp = new int[N+1];
        int b = 1000000007;
        for (int i = N; i >= 0; i--) {
            if (i == N) {
                dp[i] = 1;
                continue;
            }
            if (a[i]) {
                dp[i] = 0;
                continue;
            }
            if (i+2 > N) {
                dp[i] = dp[i+1]%b;
                continue;
            }
            dp[i] = (dp[i+1] + dp[i+2])%b;
        }
        System.out.println(dp[0]);
    } main {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        boolean[] a = new boolean[N];

        for (int i = 0; i < M; i++) {
            int n = sc.nextInt();
            a[n] = true;
        }

        int[] dp = new int[N+1];
        int b = 1000000007;
        for (int i = N; i >= 0; i--) {
            if (i == N) {
                dp[i] = 1;
                continue;
            }
            if (a[i]) {
                dp[i] = 0;
                continue;
            }
            if (i+2 > N) {
                dp[i] = dp[i+1]%b;
                continue;
            }
            dp[i] = (dp[i+1] + dp[i+2])%b;
        }
        System.out.println(dp[0]);
    } 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 boolean[] a = new boolean[N]; a new boolean[N] N for (int i = 0; i < M; i++) {
            int n = sc.nextInt();
            a[n] = true;
        } int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
            int n = sc.nextInt();
            a[n] = true;
        } {
            int n = sc.nextInt();
            a[n] = true;
        } int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc a[n] = true a[n] a n true int[] dp = new int[N+1]; dp new int[N+1] N+1 N 1 int b = 1000000007; b 1000000007 for (int i = N; i >= 0; i--) {
            if (i == N) {
                dp[i] = 1;
                continue;
            }
            if (a[i]) {
                dp[i] = 0;
                continue;
            }
            if (i+2 > N) {
                dp[i] = dp[i+1]%b;
                continue;
            }
            dp[i] = (dp[i+1] + dp[i+2])%b;
        } int i = N; int i = N; i N i >= 0 i 0 i-- i-- i {
            if (i == N) {
                dp[i] = 1;
                continue;
            }
            if (a[i]) {
                dp[i] = 0;
                continue;
            }
            if (i+2 > N) {
                dp[i] = dp[i+1]%b;
                continue;
            }
            dp[i] = (dp[i+1] + dp[i+2])%b;
        } {
            if (i == N) {
                dp[i] = 1;
                continue;
            }
            if (a[i]) {
                dp[i] = 0;
                continue;
            }
            if (i+2 > N) {
                dp[i] = dp[i+1]%b;
                continue;
            }
            dp[i] = (dp[i+1] + dp[i+2])%b;
        } if (i == N) {
                dp[i] = 1;
                continue;
            } i == N i N {
                dp[i] = 1;
                continue;
            } dp[i] = 1 dp[i] dp i 1 continue; if (a[i]) {
                dp[i] = 0;
                continue;
            } a[i] a i {
                dp[i] = 0;
                continue;
            } dp[i] = 0 dp[i] dp i 0 continue; if (i+2 > N) {
                dp[i] = dp[i+1]%b;
                continue;
            } i+2 > N i+2 i 2 N {
                dp[i] = dp[i+1]%b;
                continue;
            } dp[i] = dp[i+1]%b dp[i] dp i dp[i+1]%b dp[i+1] dp i+1 i 1 b continue; dp[i] = (dp[i+1] + dp[i+2])%b dp[i] dp i (dp[i+1] + dp[i+2])%b (dp[i+1] + dp[i+2]) dp[i+1] dp i+1 i 1 dp[i+2] dp i+2 i 2 b System.out.println(dp[0]) System.out.println System.out System System.out dp[0] dp 0 String[] args args
import java.util.Scanner;

class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        boolean[] a = new boolean[N];

        for (int i = 0; i < M; i++) {
            int n = sc.nextInt();
            a[n] = true;
        }

        int[] dp = new int[N+1];
        int b = 1000000007;
        for (int i = N; i >= 0; i--) {
            if (i == N) {
                dp[i] = 1;
                continue;
            }
            if (a[i]) {
                dp[i] = 0;
                continue;
            }
            if (i+2 > N) {
                dp[i] = dp[i+1]%b;
                continue;
            }
            dp[i] = (dp[i+1] + dp[i+2])%b;
        }
        System.out.println(dp[0]);
    }
}