import java.util.*;

public class Main {
    static long steps[];
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        Set<Integer> a = new HashSet<Integer>(M);
        steps = new long[N+1];
        for(int i=1; i<=M; i++) {
            int tmp = sc.nextInt();
            a.add(tmp);
        }

        if(N<=1) {
            System.out.println(1L);
            return;
        }
        steps[0] = 1L;
        steps[1] = a.contains(1) ? 0L : 1L;
        for(int i=2; i<=N; i++) {
            steps[i] = a.contains(i) ? 0L : (steps[i-2] + steps[i-1]) % 1000000007L;
        }
        System.out.println(steps[N]);
    }
} import java.util.*; util.* java public class Main {
    static long steps[];
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        Set<Integer> a = new HashSet<Integer>(M);
        steps = new long[N+1];
        for(int i=1; i<=M; i++) {
            int tmp = sc.nextInt();
            a.add(tmp);
        }

        if(N<=1) {
            System.out.println(1L);
            return;
        }
        steps[0] = 1L;
        steps[1] = a.contains(1) ? 0L : 1L;
        for(int i=2; i<=N; i++) {
            steps[i] = a.contains(i) ? 0L : (steps[i-2] + steps[i-1]) % 1000000007L;
        }
        System.out.println(steps[N]);
    }
} Main static long steps[]; steps public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        Set<Integer> a = new HashSet<Integer>(M);
        steps = new long[N+1];
        for(int i=1; i<=M; i++) {
            int tmp = sc.nextInt();
            a.add(tmp);
        }

        if(N<=1) {
            System.out.println(1L);
            return;
        }
        steps[0] = 1L;
        steps[1] = a.contains(1) ? 0L : 1L;
        for(int i=2; i<=N; i++) {
            steps[i] = a.contains(i) ? 0L : (steps[i-2] + steps[i-1]) % 1000000007L;
        }
        System.out.println(steps[N]);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        Set<Integer> a = new HashSet<Integer>(M);
        steps = new long[N+1];
        for(int i=1; i<=M; i++) {
            int tmp = sc.nextInt();
            a.add(tmp);
        }

        if(N<=1) {
            System.out.println(1L);
            return;
        }
        steps[0] = 1L;
        steps[1] = a.contains(1) ? 0L : 1L;
        for(int i=2; i<=N; i++) {
            steps[i] = a.contains(i) ? 0L : (steps[i-2] + steps[i-1]) % 1000000007L;
        }
        System.out.println(steps[N]);
    } 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 Set<Integer> a = new HashSet<Integer>(M); a new HashSet<Integer>(M) steps = new long[N+1] steps new long[N+1] N+1 N 1 for(int i=1; i<=M; i++) {
            int tmp = sc.nextInt();
            a.add(tmp);
        } int i=1; int i=1; i 1 i<=M i M i++ i++ i {
            int tmp = sc.nextInt();
            a.add(tmp);
        } {
            int tmp = sc.nextInt();
            a.add(tmp);
        } int tmp = sc.nextInt(); tmp sc.nextInt() sc.nextInt sc a.add(tmp) a.add a tmp if(N<=1) {
            System.out.println(1L);
            return;
        } N<=1 N 1 {
            System.out.println(1L);
            return;
        } System.out.println(1L) System.out.println System.out System System.out 1L return; steps[0] = 1L steps[0] steps 0 1L steps[1] = a.contains(1) ? 0L : 1L steps[1] steps 1 a.contains(1) ? 0L : 1L a.contains(1) a.contains a 1 0L 1L for(int i=2; i<=N; i++) {
            steps[i] = a.contains(i) ? 0L : (steps[i-2] + steps[i-1]) % 1000000007L;
        } int i=2; int i=2; i 2 i<=N i N i++ i++ i {
            steps[i] = a.contains(i) ? 0L : (steps[i-2] + steps[i-1]) % 1000000007L;
        } {
            steps[i] = a.contains(i) ? 0L : (steps[i-2] + steps[i-1]) % 1000000007L;
        } steps[i] = a.contains(i) ? 0L : (steps[i-2] + steps[i-1]) % 1000000007L steps[i] steps i a.contains(i) ? 0L : (steps[i-2] + steps[i-1]) % 1000000007L a.contains(i) a.contains a i 0L (steps[i-2] + steps[i-1]) % 1000000007L (steps[i-2] + steps[i-1]) steps[i-2] steps i-2 i 2 steps[i-1] steps i-1 i 1 1000000007L System.out.println(steps[N]) System.out.println System.out System System.out steps[N] steps N String[] args args public class Main {
    static long steps[];
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        Set<Integer> a = new HashSet<Integer>(M);
        steps = new long[N+1];
        for(int i=1; i<=M; i++) {
            int tmp = sc.nextInt();
            a.add(tmp);
        }

        if(N<=1) {
            System.out.println(1L);
            return;
        }
        steps[0] = 1L;
        steps[1] = a.contains(1) ? 0L : 1L;
        for(int i=2; i<=N; i++) {
            steps[i] = a.contains(i) ? 0L : (steps[i-2] + steps[i-1]) % 1000000007L;
        }
        System.out.println(steps[N]);
    }
} public class Main {
    static long steps[];
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        Set<Integer> a = new HashSet<Integer>(M);
        steps = new long[N+1];
        for(int i=1; i<=M; i++) {
            int tmp = sc.nextInt();
            a.add(tmp);
        }

        if(N<=1) {
            System.out.println(1L);
            return;
        }
        steps[0] = 1L;
        steps[1] = a.contains(1) ? 0L : 1L;
        for(int i=2; i<=N; i++) {
            steps[i] = a.contains(i) ? 0L : (steps[i-2] + steps[i-1]) % 1000000007L;
        }
        System.out.println(steps[N]);
    }
} Main
import java.util.*;

public class Main {
    static long steps[];
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        Set<Integer> a = new HashSet<Integer>(M);
        steps = new long[N+1];
        for(int i=1; i<=M; i++) {
            int tmp = sc.nextInt();
            a.add(tmp);
        }

        if(N<=1) {
            System.out.println(1L);
            return;
        }
        steps[0] = 1L;
        steps[1] = a.contains(1) ? 0L : 1L;
        for(int i=2; i<=N; i++) {
            steps[i] = a.contains(i) ? 0L : (steps[i-2] + steps[i-1]) % 1000000007L;
        }
        System.out.println(steps[N]);
    }
}