import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author teiwa
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        long bigInteger = 1_000_000_007;

        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();

            boolean[] brokenStairs = new boolean[n + 1];
            Arrays.fill(brokenStairs, true);
            for (int i = 0; i < m; i++) {
                int broken = in.nextInt();
                brokenStairs[broken] = false;
            }

            long[] dp = new long[n + 1];
            dp[0] = 1;
            for (int now = 0; now < n; now++) {
                for (int next = now + 1; next <= Math.min(n, now + 2); next++) {
                    if (brokenStairs[next]) {
                        dp[next] += dp[now];
                        dp[next] = dp[next] % bigInteger;
                    }
                }
            }
            out.println(dp[n]);
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        long bigInteger = 1_000_000_007;

        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();

            boolean[] brokenStairs = new boolean[n + 1];
            Arrays.fill(brokenStairs, true);
            for (int i = 0; i < m; i++) {
                int broken = in.nextInt();
                brokenStairs[broken] = false;
            }

            long[] dp = new long[n + 1];
            dp[0] = 1;
            for (int now = 0; now < n; now++) {
                for (int next = now + 1; next <= Math.min(n, now + 2); next++) {
                    if (brokenStairs[next]) {
                        dp[next] += dp[now];
                        dp[next] = dp[next] % bigInteger;
                    }
                }
            }
            out.println(dp[n]);
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) TaskC solver = new TaskC(); solver new TaskC() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class TaskC {
        long bigInteger = 1_000_000_007;

        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();

            boolean[] brokenStairs = new boolean[n + 1];
            Arrays.fill(brokenStairs, true);
            for (int i = 0; i < m; i++) {
                int broken = in.nextInt();
                brokenStairs[broken] = false;
            }

            long[] dp = new long[n + 1];
            dp[0] = 1;
            for (int now = 0; now < n; now++) {
                for (int next = now + 1; next <= Math.min(n, now + 2); next++) {
                    if (brokenStairs[next]) {
                        dp[next] += dp[now];
                        dp[next] = dp[next] % bigInteger;
                    }
                }
            }
            out.println(dp[n]);
        }

    } TaskC long bigInteger = 1_000_000_007; bigInteger 1_000_000_007 public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();

            boolean[] brokenStairs = new boolean[n + 1];
            Arrays.fill(brokenStairs, true);
            for (int i = 0; i < m; i++) {
                int broken = in.nextInt();
                brokenStairs[broken] = false;
            }

            long[] dp = new long[n + 1];
            dp[0] = 1;
            for (int now = 0; now < n; now++) {
                for (int next = now + 1; next <= Math.min(n, now + 2); next++) {
                    if (brokenStairs[next]) {
                        dp[next] += dp[now];
                        dp[next] = dp[next] % bigInteger;
                    }
                }
            }
            out.println(dp[n]);
        } solve {
            int n = in.nextInt();
            int m = in.nextInt();

            boolean[] brokenStairs = new boolean[n + 1];
            Arrays.fill(brokenStairs, true);
            for (int i = 0; i < m; i++) {
                int broken = in.nextInt();
                brokenStairs[broken] = false;
            }

            long[] dp = new long[n + 1];
            dp[0] = 1;
            for (int now = 0; now < n; now++) {
                for (int next = now + 1; next <= Math.min(n, now + 2); next++) {
                    if (brokenStairs[next]) {
                        dp[next] += dp[now];
                        dp[next] = dp[next] % bigInteger;
                    }
                }
            }
            out.println(dp[n]);
        } int n = in.nextInt(); n in.nextInt() in.nextInt in int m = in.nextInt(); m in.nextInt() in.nextInt in boolean[] brokenStairs = new boolean[n + 1]; brokenStairs new boolean[n + 1] n + 1 n 1 Arrays.fill(brokenStairs, true) Arrays.fill Arrays brokenStairs true for (int i = 0; i < m; i++) {
                int broken = in.nextInt();
                brokenStairs[broken] = false;
            } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
                int broken = in.nextInt();
                brokenStairs[broken] = false;
            } {
                int broken = in.nextInt();
                brokenStairs[broken] = false;
            } int broken = in.nextInt(); broken in.nextInt() in.nextInt in brokenStairs[broken] = false brokenStairs[broken] brokenStairs broken false long[] dp = new long[n + 1]; dp new long[n + 1] n + 1 n 1 dp[0] = 1 dp[0] dp 0 1 for (int now = 0; now < n; now++) {
                for (int next = now + 1; next <= Math.min(n, now + 2); next++) {
                    if (brokenStairs[next]) {
                        dp[next] += dp[now];
                        dp[next] = dp[next] % bigInteger;
                    }
                }
            } int now = 0; int now = 0; now 0 now < n now n now++ now++ now {
                for (int next = now + 1; next <= Math.min(n, now + 2); next++) {
                    if (brokenStairs[next]) {
                        dp[next] += dp[now];
                        dp[next] = dp[next] % bigInteger;
                    }
                }
            } {
                for (int next = now + 1; next <= Math.min(n, now + 2); next++) {
                    if (brokenStairs[next]) {
                        dp[next] += dp[now];
                        dp[next] = dp[next] % bigInteger;
                    }
                }
            } for (int next = now + 1; next <= Math.min(n, now + 2); next++) {
                    if (brokenStairs[next]) {
                        dp[next] += dp[now];
                        dp[next] = dp[next] % bigInteger;
                    }
                } int next = now + 1; int next = now + 1; next now + 1 now 1 next <= Math.min(n, now + 2) next Math.min(n, now + 2) Math.min Math n now + 2 now 2 next++ next++ next {
                    if (brokenStairs[next]) {
                        dp[next] += dp[now];
                        dp[next] = dp[next] % bigInteger;
                    }
                } {
                    if (brokenStairs[next]) {
                        dp[next] += dp[now];
                        dp[next] = dp[next] % bigInteger;
                    }
                } if (brokenStairs[next]) {
                        dp[next] += dp[now];
                        dp[next] = dp[next] % bigInteger;
                    } brokenStairs[next] brokenStairs next {
                        dp[next] += dp[now];
                        dp[next] = dp[next] % bigInteger;
                    } dp[next] += dp[now] dp[next] dp next dp[now] dp now dp[next] = dp[next] % bigInteger dp[next] dp next dp[next] % bigInteger dp[next] dp next bigInteger out.println(dp[n]) out.println out dp[n] dp n int testNumber testNumber Scanner in in PrintWriter out out public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        long bigInteger = 1_000_000_007;

        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();

            boolean[] brokenStairs = new boolean[n + 1];
            Arrays.fill(brokenStairs, true);
            for (int i = 0; i < m; i++) {
                int broken = in.nextInt();
                brokenStairs[broken] = false;
            }

            long[] dp = new long[n + 1];
            dp[0] = 1;
            for (int now = 0; now < n; now++) {
                for (int next = now + 1; next <= Math.min(n, now + 2); next++) {
                    if (brokenStairs[next]) {
                        dp[next] += dp[now];
                        dp[next] = dp[next] % bigInteger;
                    }
                }
            }
            out.println(dp[n]);
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        long bigInteger = 1_000_000_007;

        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();

            boolean[] brokenStairs = new boolean[n + 1];
            Arrays.fill(brokenStairs, true);
            for (int i = 0; i < m; i++) {
                int broken = in.nextInt();
                brokenStairs[broken] = false;
            }

            long[] dp = new long[n + 1];
            dp[0] = 1;
            for (int now = 0; now < n; now++) {
                for (int next = now + 1; next <= Math.min(n, now + 2); next++) {
                    if (brokenStairs[next]) {
                        dp[next] += dp[now];
                        dp[next] = dp[next] % bigInteger;
                    }
                }
            }
            out.println(dp[n]);
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author teiwa
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        long bigInteger = 1_000_000_007;

        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();

            boolean[] brokenStairs = new boolean[n + 1];
            Arrays.fill(brokenStairs, true);
            for (int i = 0; i < m; i++) {
                int broken = in.nextInt();
                brokenStairs[broken] = false;
            }

            long[] dp = new long[n + 1];
            dp[0] = 1;
            for (int now = 0; now < n; now++) {
                for (int next = now + 1; next <= Math.min(n, now + 2); next++) {
                    if (brokenStairs[next]) {
                        dp[next] += dp[now];
                        dp[next] = dp[next] % bigInteger;
                    }
                }
            }
            out.println(dp[n]);
        }

    }
}

