import java.io.*;
import java.rmi.MarshalledObject;
import java.util.*;

public class Main {
    static final long MOD = 1000000007;

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long M;
        M = sc.nextLong();
        Set<Long> a = new HashSet<>();
        for(int i = 0 ; i < M ; i++){
            a.add(sc.nextLong());
        }

        final Solver solver = new Solver();
        System.out.println(solver.solve(N, a));
    }
}

class Solver {
    final Map<Long, Long> memo = new HashMap<>();

    public long solve(long N, Set<Long> a) {

        long[] dp = new long[(int) (N + 1)];
        dp[0] = 1;
        for (long now = 0; now < N; now++) {
            for (long next = now + 1; next <= Math.min(now + 2, N); next++) {
                if (!a.contains(next)) {
                    dp[(int) next] += dp[(int) now];
                    dp[(int) next] %= Main.MOD;
                }
            }
        }
        return dp[(int) N];
    }

}
 import java.io.*; io.* java import java.rmi.MarshalledObject; MarshalledObject java.rmi import java.util.*; util.* java public class Main {
    static final long MOD = 1000000007;

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long M;
        M = sc.nextLong();
        Set<Long> a = new HashSet<>();
        for(int i = 0 ; i < M ; i++){
            a.add(sc.nextLong());
        }

        final Solver solver = new Solver();
        System.out.println(solver.solve(N, a));
    }
} Main static final long MOD = 1000000007; MOD 1000000007 public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long M;
        M = sc.nextLong();
        Set<Long> a = new HashSet<>();
        for(int i = 0 ; i < M ; i++){
            a.add(sc.nextLong());
        }

        final Solver solver = new Solver();
        System.out.println(solver.solve(N, a));
    } main {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long M;
        M = sc.nextLong();
        Set<Long> a = new HashSet<>();
        for(int i = 0 ; i < M ; i++){
            a.add(sc.nextLong());
        }

        final Solver solver = new Solver();
        System.out.println(solver.solve(N, a));
    } final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N; N N = sc.nextLong() N sc.nextLong() sc.nextLong sc long M; M M = sc.nextLong() M sc.nextLong() sc.nextLong sc Set<Long> a = new HashSet<>(); a new HashSet<>() for(int i = 0 ; i < M ; i++){
            a.add(sc.nextLong());
        } int i = 0 ; int i = 0 ; i 0 i < M i M i++ i++ i {
            a.add(sc.nextLong());
        } {
            a.add(sc.nextLong());
        } a.add(sc.nextLong()) a.add a sc.nextLong() sc.nextLong sc final Solver solver = new Solver(); solver new Solver() System.out.println(solver.solve(N, a)) System.out.println System.out System System.out solver.solve(N, a) solver.solve solver N a final String[] args args class Solver {
    final Map<Long, Long> memo = new HashMap<>();

    public long solve(long N, Set<Long> a) {

        long[] dp = new long[(int) (N + 1)];
        dp[0] = 1;
        for (long now = 0; now < N; now++) {
            for (long next = now + 1; next <= Math.min(now + 2, N); next++) {
                if (!a.contains(next)) {
                    dp[(int) next] += dp[(int) now];
                    dp[(int) next] %= Main.MOD;
                }
            }
        }
        return dp[(int) N];
    }

} Solver final Map<Long, Long> memo = new HashMap<>(); memo new HashMap<>() public long solve(long N, Set<Long> a) {

        long[] dp = new long[(int) (N + 1)];
        dp[0] = 1;
        for (long now = 0; now < N; now++) {
            for (long next = now + 1; next <= Math.min(now + 2, N); next++) {
                if (!a.contains(next)) {
                    dp[(int) next] += dp[(int) now];
                    dp[(int) next] %= Main.MOD;
                }
            }
        }
        return dp[(int) N];
    } solve {

        long[] dp = new long[(int) (N + 1)];
        dp[0] = 1;
        for (long now = 0; now < N; now++) {
            for (long next = now + 1; next <= Math.min(now + 2, N); next++) {
                if (!a.contains(next)) {
                    dp[(int) next] += dp[(int) now];
                    dp[(int) next] %= Main.MOD;
                }
            }
        }
        return dp[(int) N];
    } long[] dp = new long[(int) (N + 1)]; dp new long[(int) (N + 1)] (int) (N + 1) N 1 dp[0] = 1 dp[0] dp 0 1 for (long now = 0; now < N; now++) {
            for (long next = now + 1; next <= Math.min(now + 2, N); next++) {
                if (!a.contains(next)) {
                    dp[(int) next] += dp[(int) now];
                    dp[(int) next] %= Main.MOD;
                }
            }
        } long now = 0; long now = 0; now 0 now < N now N now++ now++ now {
            for (long next = now + 1; next <= Math.min(now + 2, N); next++) {
                if (!a.contains(next)) {
                    dp[(int) next] += dp[(int) now];
                    dp[(int) next] %= Main.MOD;
                }
            }
        } {
            for (long next = now + 1; next <= Math.min(now + 2, N); next++) {
                if (!a.contains(next)) {
                    dp[(int) next] += dp[(int) now];
                    dp[(int) next] %= Main.MOD;
                }
            }
        } for (long next = now + 1; next <= Math.min(now + 2, N); next++) {
                if (!a.contains(next)) {
                    dp[(int) next] += dp[(int) now];
                    dp[(int) next] %= Main.MOD;
                }
            } long next = now + 1; long next = now + 1; next now + 1 now 1 next <= Math.min(now + 2, N) next Math.min(now + 2, N) Math.min Math now + 2 now 2 N next++ next++ next {
                if (!a.contains(next)) {
                    dp[(int) next] += dp[(int) now];
                    dp[(int) next] %= Main.MOD;
                }
            } {
                if (!a.contains(next)) {
                    dp[(int) next] += dp[(int) now];
                    dp[(int) next] %= Main.MOD;
                }
            } if (!a.contains(next)) {
                    dp[(int) next] += dp[(int) now];
                    dp[(int) next] %= Main.MOD;
                } !a.contains(next) a.contains(next) a.contains a next {
                    dp[(int) next] += dp[(int) now];
                    dp[(int) next] %= Main.MOD;
                } dp[(int) next] += dp[(int) now] dp[(int) next] dp (int) next dp[(int) now] dp (int) now dp[(int) next] %= Main.MOD dp[(int) next] dp (int) next Main.MOD Main Main.MOD return dp[(int) N]; dp[(int) N] dp (int) N long N N Set<Long> a a public class Main {
    static final long MOD = 1000000007;

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long M;
        M = sc.nextLong();
        Set<Long> a = new HashSet<>();
        for(int i = 0 ; i < M ; i++){
            a.add(sc.nextLong());
        }

        final Solver solver = new Solver();
        System.out.println(solver.solve(N, a));
    }
} public class Main {
    static final long MOD = 1000000007;

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long M;
        M = sc.nextLong();
        Set<Long> a = new HashSet<>();
        for(int i = 0 ; i < M ; i++){
            a.add(sc.nextLong());
        }

        final Solver solver = new Solver();
        System.out.println(solver.solve(N, a));
    }
} Main
import java.io.*;
import java.rmi.MarshalledObject;
import java.util.*;

public class Main {
    static final long MOD = 1000000007;

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        long M;
        M = sc.nextLong();
        Set<Long> a = new HashSet<>();
        for(int i = 0 ; i < M ; i++){
            a.add(sc.nextLong());
        }

        final Solver solver = new Solver();
        System.out.println(solver.solve(N, a));
    }
}

class Solver {
    final Map<Long, Long> memo = new HashMap<>();

    public long solve(long N, Set<Long> a) {

        long[] dp = new long[(int) (N + 1)];
        dp[0] = 1;
        for (long now = 0; now < N; now++) {
            for (long next = now + 1; next <= Math.min(now + 2, N); next++) {
                if (!a.contains(next)) {
                    dp[(int) next] += dp[(int) now];
                    dp[(int) next] %= Main.MOD;
                }
            }
        }
        return dp[(int) N];
    }

}

