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

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
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);
        TypicalStairs solver = new TypicalStairs();
        solver.solve(1, in, out);
        out.close();
    }

    static class TypicalStairs {
        public static int MOD = 1_000_000_007;

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

            int[] stairs = new int[n + 1];
            long[] route = new long[n + 1];

            for (int i = 1; i <= m; i++) {
                int step = in.nextInt();
                stairs[step] = 1;
            }

            route[0] = 1;
            if (stairs[1] == 0) {
                route[1] = 1;
            }

            for (int i = 2; i <= n; i++) {
                if (stairs[i - 1] == 0) {
                    route[i] = route[i] + route[i - 1];
                }
                if (stairs[i - 2] == 0) {
                    route[i] = route[i] + route[i - 2];
                }
                route[i] %= MOD;
            }

            out.print(route[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.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);
        TypicalStairs solver = new TypicalStairs();
        solver.solve(1, in, out);
        out.close();
    }

    static class TypicalStairs {
        public static int MOD = 1_000_000_007;

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

            int[] stairs = new int[n + 1];
            long[] route = new long[n + 1];

            for (int i = 1; i <= m; i++) {
                int step = in.nextInt();
                stairs[step] = 1;
            }

            route[0] = 1;
            if (stairs[1] == 0) {
                route[1] = 1;
            }

            for (int i = 2; i <= n; i++) {
                if (stairs[i - 1] == 0) {
                    route[i] = route[i] + route[i - 1];
                }
                if (stairs[i - 2] == 0) {
                    route[i] = route[i] + route[i - 2];
                }
                route[i] %= MOD;
            }

            out.print(route[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);
        TypicalStairs solver = new TypicalStairs();
        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);
        TypicalStairs solver = new TypicalStairs();
        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) TypicalStairs solver = new TypicalStairs(); solver new TypicalStairs() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class TypicalStairs {
        public static int MOD = 1_000_000_007;

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

            int[] stairs = new int[n + 1];
            long[] route = new long[n + 1];

            for (int i = 1; i <= m; i++) {
                int step = in.nextInt();
                stairs[step] = 1;
            }

            route[0] = 1;
            if (stairs[1] == 0) {
                route[1] = 1;
            }

            for (int i = 2; i <= n; i++) {
                if (stairs[i - 1] == 0) {
                    route[i] = route[i] + route[i - 1];
                }
                if (stairs[i - 2] == 0) {
                    route[i] = route[i] + route[i - 2];
                }
                route[i] %= MOD;
            }

            out.print(route[n]);

        }

    } TypicalStairs public static int MOD = 1_000_000_007; MOD 1_000_000_007 public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();

            int[] stairs = new int[n + 1];
            long[] route = new long[n + 1];

            for (int i = 1; i <= m; i++) {
                int step = in.nextInt();
                stairs[step] = 1;
            }

            route[0] = 1;
            if (stairs[1] == 0) {
                route[1] = 1;
            }

            for (int i = 2; i <= n; i++) {
                if (stairs[i - 1] == 0) {
                    route[i] = route[i] + route[i - 1];
                }
                if (stairs[i - 2] == 0) {
                    route[i] = route[i] + route[i - 2];
                }
                route[i] %= MOD;
            }

            out.print(route[n]);

        } solve {
            int n = in.nextInt();
            int m = in.nextInt();

            int[] stairs = new int[n + 1];
            long[] route = new long[n + 1];

            for (int i = 1; i <= m; i++) {
                int step = in.nextInt();
                stairs[step] = 1;
            }

            route[0] = 1;
            if (stairs[1] == 0) {
                route[1] = 1;
            }

            for (int i = 2; i <= n; i++) {
                if (stairs[i - 1] == 0) {
                    route[i] = route[i] + route[i - 1];
                }
                if (stairs[i - 2] == 0) {
                    route[i] = route[i] + route[i - 2];
                }
                route[i] %= MOD;
            }

            out.print(route[n]);

        } int n = in.nextInt(); n in.nextInt() in.nextInt in int m = in.nextInt(); m in.nextInt() in.nextInt in int[] stairs = new int[n + 1]; stairs new int[n + 1] n + 1 n 1 long[] route = new long[n + 1]; route new long[n + 1] n + 1 n 1 for (int i = 1; i <= m; i++) {
                int step = in.nextInt();
                stairs[step] = 1;
            } int i = 1; int i = 1; i 1 i <= m i m i++ i++ i {
                int step = in.nextInt();
                stairs[step] = 1;
            } {
                int step = in.nextInt();
                stairs[step] = 1;
            } int step = in.nextInt(); step in.nextInt() in.nextInt in stairs[step] = 1 stairs[step] stairs step 1 route[0] = 1 route[0] route 0 1 if (stairs[1] == 0) {
                route[1] = 1;
            } stairs[1] == 0 stairs[1] stairs 1 0 {
                route[1] = 1;
            } route[1] = 1 route[1] route 1 1 for (int i = 2; i <= n; i++) {
                if (stairs[i - 1] == 0) {
                    route[i] = route[i] + route[i - 1];
                }
                if (stairs[i - 2] == 0) {
                    route[i] = route[i] + route[i - 2];
                }
                route[i] %= MOD;
            } int i = 2; int i = 2; i 2 i <= n i n i++ i++ i {
                if (stairs[i - 1] == 0) {
                    route[i] = route[i] + route[i - 1];
                }
                if (stairs[i - 2] == 0) {
                    route[i] = route[i] + route[i - 2];
                }
                route[i] %= MOD;
            } {
                if (stairs[i - 1] == 0) {
                    route[i] = route[i] + route[i - 1];
                }
                if (stairs[i - 2] == 0) {
                    route[i] = route[i] + route[i - 2];
                }
                route[i] %= MOD;
            } if (stairs[i - 1] == 0) {
                    route[i] = route[i] + route[i - 1];
                } stairs[i - 1] == 0 stairs[i - 1] stairs i - 1 i 1 0 {
                    route[i] = route[i] + route[i - 1];
                } route[i] = route[i] + route[i - 1] route[i] route i route[i] + route[i - 1] route[i] route i route[i - 1] route i - 1 i 1 if (stairs[i - 2] == 0) {
                    route[i] = route[i] + route[i - 2];
                } stairs[i - 2] == 0 stairs[i - 2] stairs i - 2 i 2 0 {
                    route[i] = route[i] + route[i - 2];
                } route[i] = route[i] + route[i - 2] route[i] route i route[i] + route[i - 2] route[i] route i route[i - 2] route i - 2 i 2 route[i] %= MOD route[i] route i MOD out.print(route[n]) out.print out route[n] route 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);
        TypicalStairs solver = new TypicalStairs();
        solver.solve(1, in, out);
        out.close();
    }

    static class TypicalStairs {
        public static int MOD = 1_000_000_007;

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

            int[] stairs = new int[n + 1];
            long[] route = new long[n + 1];

            for (int i = 1; i <= m; i++) {
                int step = in.nextInt();
                stairs[step] = 1;
            }

            route[0] = 1;
            if (stairs[1] == 0) {
                route[1] = 1;
            }

            for (int i = 2; i <= n; i++) {
                if (stairs[i - 1] == 0) {
                    route[i] = route[i] + route[i - 1];
                }
                if (stairs[i - 2] == 0) {
                    route[i] = route[i] + route[i - 2];
                }
                route[i] %= MOD;
            }

            out.print(route[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);
        TypicalStairs solver = new TypicalStairs();
        solver.solve(1, in, out);
        out.close();
    }

    static class TypicalStairs {
        public static int MOD = 1_000_000_007;

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

            int[] stairs = new int[n + 1];
            long[] route = new long[n + 1];

            for (int i = 1; i <= m; i++) {
                int step = in.nextInt();
                stairs[step] = 1;
            }

            route[0] = 1;
            if (stairs[1] == 0) {
                route[1] = 1;
            }

            for (int i = 2; i <= n; i++) {
                if (stairs[i - 1] == 0) {
                    route[i] = route[i] + route[i - 1];
                }
                if (stairs[i - 2] == 0) {
                    route[i] = route[i] + route[i - 2];
                }
                route[i] %= MOD;
            }

            out.print(route[n]);

        }

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

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
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);
        TypicalStairs solver = new TypicalStairs();
        solver.solve(1, in, out);
        out.close();
    }

    static class TypicalStairs {
        public static int MOD = 1_000_000_007;

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

            int[] stairs = new int[n + 1];
            long[] route = new long[n + 1];

            for (int i = 1; i <= m; i++) {
                int step = in.nextInt();
                stairs[step] = 1;
            }

            route[0] = 1;
            if (stairs[1] == 0) {
                route[1] = 1;
            }

            for (int i = 2; i <= n; i++) {
                if (stairs[i - 1] == 0) {
                    route[i] = route[i] + route[i - 1];
                }
                if (stairs[i - 2] == 0) {
                    route[i] = route[i] + route[i - 2];
                }
                route[i] %= MOD;
            }

            out.print(route[n]);

        }

    }
}

