import java.util.*;

public class Main {

    public static List<List<Integer>> switchList;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        Set<Integer> brokenTyles = new HashSet();
        for (int i = 0; i < M; i++) {
            brokenTyles.add(Integer.parseInt(sc.next()));
        }
        sc.close();

        long[] patterns = new long[N + 1];
        patterns[0] = 0;
        if (brokenTyles.contains(1)) {
            patterns[1] = 0;
        } else {
            patterns[1] = 1;
        }

        if (N > 1) {
            if (brokenTyles.contains(2)) {
                patterns[2] = 0;
            } else {
                patterns[2] = patterns[1] + 1;
            }
        }

        long baseVal = (long) Math.pow(10, 9) + 7;

        for (int i = 3; i <= N; i++) {
            if (brokenTyles.contains(i)) {
                patterns[i] = 0;
            } else {
                patterns[i] = (patterns[i - 1] + patterns[i - 2]) % baseVal;
                if (patterns[i] == 0) {
                    patterns[N] = 0;
                    break;
                }
            }
        }

        long val = patterns[N];
        System.out.println(val);
    }

} import java.util.*; util.* java public class Main {

    public static List<List<Integer>> switchList;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        Set<Integer> brokenTyles = new HashSet();
        for (int i = 0; i < M; i++) {
            brokenTyles.add(Integer.parseInt(sc.next()));
        }
        sc.close();

        long[] patterns = new long[N + 1];
        patterns[0] = 0;
        if (brokenTyles.contains(1)) {
            patterns[1] = 0;
        } else {
            patterns[1] = 1;
        }

        if (N > 1) {
            if (brokenTyles.contains(2)) {
                patterns[2] = 0;
            } else {
                patterns[2] = patterns[1] + 1;
            }
        }

        long baseVal = (long) Math.pow(10, 9) + 7;

        for (int i = 3; i <= N; i++) {
            if (brokenTyles.contains(i)) {
                patterns[i] = 0;
            } else {
                patterns[i] = (patterns[i - 1] + patterns[i - 2]) % baseVal;
                if (patterns[i] == 0) {
                    patterns[N] = 0;
                    break;
                }
            }
        }

        long val = patterns[N];
        System.out.println(val);
    }

} Main public static List<List<Integer>> switchList; switchList public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        Set<Integer> brokenTyles = new HashSet();
        for (int i = 0; i < M; i++) {
            brokenTyles.add(Integer.parseInt(sc.next()));
        }
        sc.close();

        long[] patterns = new long[N + 1];
        patterns[0] = 0;
        if (brokenTyles.contains(1)) {
            patterns[1] = 0;
        } else {
            patterns[1] = 1;
        }

        if (N > 1) {
            if (brokenTyles.contains(2)) {
                patterns[2] = 0;
            } else {
                patterns[2] = patterns[1] + 1;
            }
        }

        long baseVal = (long) Math.pow(10, 9) + 7;

        for (int i = 3; i <= N; i++) {
            if (brokenTyles.contains(i)) {
                patterns[i] = 0;
            } else {
                patterns[i] = (patterns[i - 1] + patterns[i - 2]) % baseVal;
                if (patterns[i] == 0) {
                    patterns[N] = 0;
                    break;
                }
            }
        }

        long val = patterns[N];
        System.out.println(val);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        Set<Integer> brokenTyles = new HashSet();
        for (int i = 0; i < M; i++) {
            brokenTyles.add(Integer.parseInt(sc.next()));
        }
        sc.close();

        long[] patterns = new long[N + 1];
        patterns[0] = 0;
        if (brokenTyles.contains(1)) {
            patterns[1] = 0;
        } else {
            patterns[1] = 1;
        }

        if (N > 1) {
            if (brokenTyles.contains(2)) {
                patterns[2] = 0;
            } else {
                patterns[2] = patterns[1] + 1;
            }
        }

        long baseVal = (long) Math.pow(10, 9) + 7;

        for (int i = 3; i <= N; i++) {
            if (brokenTyles.contains(i)) {
                patterns[i] = 0;
            } else {
                patterns[i] = (patterns[i - 1] + patterns[i - 2]) % baseVal;
                if (patterns[i] == 0) {
                    patterns[N] = 0;
                    break;
                }
            }
        }

        long val = patterns[N];
        System.out.println(val);
    } 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> brokenTyles = new HashSet(); brokenTyles new HashSet() for (int i = 0; i < M; i++) {
            brokenTyles.add(Integer.parseInt(sc.next()));
        } int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
            brokenTyles.add(Integer.parseInt(sc.next()));
        } {
            brokenTyles.add(Integer.parseInt(sc.next()));
        } brokenTyles.add(Integer.parseInt(sc.next())) brokenTyles.add brokenTyles Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc sc.close() sc.close sc long[] patterns = new long[N + 1]; patterns new long[N + 1] N + 1 N 1 patterns[0] = 0 patterns[0] patterns 0 0 if (brokenTyles.contains(1)) {
            patterns[1] = 0;
        } else {
            patterns[1] = 1;
        } brokenTyles.contains(1) brokenTyles.contains brokenTyles 1 {
            patterns[1] = 0;
        } patterns[1] = 0 patterns[1] patterns 1 0 {
            patterns[1] = 1;
        } patterns[1] = 1 patterns[1] patterns 1 1 if (N > 1) {
            if (brokenTyles.contains(2)) {
                patterns[2] = 0;
            } else {
                patterns[2] = patterns[1] + 1;
            }
        } N > 1 N 1 {
            if (brokenTyles.contains(2)) {
                patterns[2] = 0;
            } else {
                patterns[2] = patterns[1] + 1;
            }
        } if (brokenTyles.contains(2)) {
                patterns[2] = 0;
            } else {
                patterns[2] = patterns[1] + 1;
            } brokenTyles.contains(2) brokenTyles.contains brokenTyles 2 {
                patterns[2] = 0;
            } patterns[2] = 0 patterns[2] patterns 2 0 {
                patterns[2] = patterns[1] + 1;
            } patterns[2] = patterns[1] + 1 patterns[2] patterns 2 patterns[1] + 1 patterns[1] patterns 1 1 long baseVal = (long) Math.pow(10, 9) + 7; baseVal (long) Math.pow(10, 9) + 7 (long) Math.pow(10, 9) Math.pow Math 10 9 7 for (int i = 3; i <= N; i++) {
            if (brokenTyles.contains(i)) {
                patterns[i] = 0;
            } else {
                patterns[i] = (patterns[i - 1] + patterns[i - 2]) % baseVal;
                if (patterns[i] == 0) {
                    patterns[N] = 0;
                    break;
                }
            }
        } int i = 3; int i = 3; i 3 i <= N i N i++ i++ i {
            if (brokenTyles.contains(i)) {
                patterns[i] = 0;
            } else {
                patterns[i] = (patterns[i - 1] + patterns[i - 2]) % baseVal;
                if (patterns[i] == 0) {
                    patterns[N] = 0;
                    break;
                }
            }
        } {
            if (brokenTyles.contains(i)) {
                patterns[i] = 0;
            } else {
                patterns[i] = (patterns[i - 1] + patterns[i - 2]) % baseVal;
                if (patterns[i] == 0) {
                    patterns[N] = 0;
                    break;
                }
            }
        } if (brokenTyles.contains(i)) {
                patterns[i] = 0;
            } else {
                patterns[i] = (patterns[i - 1] + patterns[i - 2]) % baseVal;
                if (patterns[i] == 0) {
                    patterns[N] = 0;
                    break;
                }
            } brokenTyles.contains(i) brokenTyles.contains brokenTyles i {
                patterns[i] = 0;
            } patterns[i] = 0 patterns[i] patterns i 0 {
                patterns[i] = (patterns[i - 1] + patterns[i - 2]) % baseVal;
                if (patterns[i] == 0) {
                    patterns[N] = 0;
                    break;
                }
            } patterns[i] = (patterns[i - 1] + patterns[i - 2]) % baseVal patterns[i] patterns i (patterns[i - 1] + patterns[i - 2]) % baseVal (patterns[i - 1] + patterns[i - 2]) patterns[i - 1] patterns i - 1 i 1 patterns[i - 2] patterns i - 2 i 2 baseVal if (patterns[i] == 0) {
                    patterns[N] = 0;
                    break;
                } patterns[i] == 0 patterns[i] patterns i 0 {
                    patterns[N] = 0;
                    break;
                } patterns[N] = 0 patterns[N] patterns N 0 break; long val = patterns[N]; val patterns[N] patterns N System.out.println(val) System.out.println System.out System System.out val String[] args args public class Main {

    public static List<List<Integer>> switchList;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        Set<Integer> brokenTyles = new HashSet();
        for (int i = 0; i < M; i++) {
            brokenTyles.add(Integer.parseInt(sc.next()));
        }
        sc.close();

        long[] patterns = new long[N + 1];
        patterns[0] = 0;
        if (brokenTyles.contains(1)) {
            patterns[1] = 0;
        } else {
            patterns[1] = 1;
        }

        if (N > 1) {
            if (brokenTyles.contains(2)) {
                patterns[2] = 0;
            } else {
                patterns[2] = patterns[1] + 1;
            }
        }

        long baseVal = (long) Math.pow(10, 9) + 7;

        for (int i = 3; i <= N; i++) {
            if (brokenTyles.contains(i)) {
                patterns[i] = 0;
            } else {
                patterns[i] = (patterns[i - 1] + patterns[i - 2]) % baseVal;
                if (patterns[i] == 0) {
                    patterns[N] = 0;
                    break;
                }
            }
        }

        long val = patterns[N];
        System.out.println(val);
    }

} public class Main {

    public static List<List<Integer>> switchList;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        Set<Integer> brokenTyles = new HashSet();
        for (int i = 0; i < M; i++) {
            brokenTyles.add(Integer.parseInt(sc.next()));
        }
        sc.close();

        long[] patterns = new long[N + 1];
        patterns[0] = 0;
        if (brokenTyles.contains(1)) {
            patterns[1] = 0;
        } else {
            patterns[1] = 1;
        }

        if (N > 1) {
            if (brokenTyles.contains(2)) {
                patterns[2] = 0;
            } else {
                patterns[2] = patterns[1] + 1;
            }
        }

        long baseVal = (long) Math.pow(10, 9) + 7;

        for (int i = 3; i <= N; i++) {
            if (brokenTyles.contains(i)) {
                patterns[i] = 0;
            } else {
                patterns[i] = (patterns[i - 1] + patterns[i - 2]) % baseVal;
                if (patterns[i] == 0) {
                    patterns[N] = 0;
                    break;
                }
            }
        }

        long val = patterns[N];
        System.out.println(val);
    }

} Main
import java.util.*;

public class Main {

    public static List<List<Integer>> switchList;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        Set<Integer> brokenTyles = new HashSet();
        for (int i = 0; i < M; i++) {
            brokenTyles.add(Integer.parseInt(sc.next()));
        }
        sc.close();

        long[] patterns = new long[N + 1];
        patterns[0] = 0;
        if (brokenTyles.contains(1)) {
            patterns[1] = 0;
        } else {
            patterns[1] = 1;
        }

        if (N > 1) {
            if (brokenTyles.contains(2)) {
                patterns[2] = 0;
            } else {
                patterns[2] = patterns[1] + 1;
            }
        }

        long baseVal = (long) Math.pow(10, 9) + 7;

        for (int i = 3; i <= N; i++) {
            if (brokenTyles.contains(i)) {
                patterns[i] = 0;
            } else {
                patterns[i] = (patterns[i - 1] + patterns[i - 2]) % baseVal;
                if (patterns[i] == 0) {
                    patterns[N] = 0;
                    break;
                }
            }
        }

        long val = patterns[N];
        System.out.println(val);
    }

}
