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;
                if (stairs[step - 1] == 1) {
                    out.print(0);
                    return;
                }
            }

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

            if (n <= 1) {
                out.print(route[1]);
                return;
            }

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

            out.print(route[n] % MOD);

        }

    }
}
 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;
                if (stairs[step - 1] == 1) {
                    out.print(0);
                    return;
                }
            }

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

            if (n <= 1) {
                out.print(route[1]);
                return;
            }

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

            out.print(route[n] % MOD);

        }

    }
} 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;
                if (stairs[step - 1] == 1) {
                    out.print(0);
                    return;
                }
            }

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

            if (n <= 1) {
                out.print(route[1]);
                return;
            }

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

            out.print(route[n] % MOD);

        }

    } 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;
                if (stairs[step - 1] == 1) {
                    out.print(0);
                    return;
                }
            }

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

            if (n <= 1) {
                out.print(route[1]);
                return;
            }

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

            out.print(route[n] % MOD);

        } 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;
                if (stairs[step - 1] == 1) {
                    out.print(0);
                    return;
                }
            }

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

            if (n <= 1) {
                out.print(route[1]);
                return;
            }

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

            out.print(route[n] % MOD);

        } 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;
                if (stairs[step - 1] == 1) {
                    out.print(0);
                    return;
                }
            } int i = 1; int i = 1; i 1 i <= m i m i++ i++ i {
                int step = in.nextInt();
                stairs[step] = 1;
                if (stairs[step - 1] == 1) {
                    out.print(0);
                    return;
                }
            } {
                int step = in.nextInt();
                stairs[step] = 1;
                if (stairs[step - 1] == 1) {
                    out.print(0);
                    return;
                }
            } int step = in.nextInt(); step in.nextInt() in.nextInt in stairs[step] = 1 stairs[step] stairs step 1 if (stairs[step - 1] == 1) {
                    out.print(0);
                    return;
                } stairs[step - 1] == 1 stairs[step - 1] stairs step - 1 step 1 1 {
                    out.print(0);
                    return;
                } out.print(0) out.print out 0 return; 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 if (n <= 1) {
                out.print(route[1]);
                return;
            } n <= 1 n 1 {
                out.print(route[1]);
                return;
            } out.print(route[1]) out.print out route[1] route 1 return; if (stairs[2] == 0) {
                route[2] = 1;
            } stairs[2] == 0 stairs[2] stairs 2 0 {
                route[2] = 1;
            } route[2] = 1 route[2] route 2 1 for (int i = 1; i <= n - 1; i++) {
                if (stairs[i] == 1) {
                    continue;
                }
                if ((i + 1) <= n && stairs[i + 1] == 0) {
                    route[i + 1] = (route[i] + route[i + 1]) % MOD;
                }
                if ((i + 2) <= n && stairs[i + 2] == 0) {
                    route[i + 2] = (route[i] + route[i + 2]) % MOD;
                }
            } int i = 1; int i = 1; i 1 i <= n - 1 i n - 1 n 1 i++ i++ i {
                if (stairs[i] == 1) {
                    continue;
                }
                if ((i + 1) <= n && stairs[i + 1] == 0) {
                    route[i + 1] = (route[i] + route[i + 1]) % MOD;
                }
                if ((i + 2) <= n && stairs[i + 2] == 0) {
                    route[i + 2] = (route[i] + route[i + 2]) % MOD;
                }
            } {
                if (stairs[i] == 1) {
                    continue;
                }
                if ((i + 1) <= n && stairs[i + 1] == 0) {
                    route[i + 1] = (route[i] + route[i + 1]) % MOD;
                }
                if ((i + 2) <= n && stairs[i + 2] == 0) {
                    route[i + 2] = (route[i] + route[i + 2]) % MOD;
                }
            } if (stairs[i] == 1) {
                    continue;
                } stairs[i] == 1 stairs[i] stairs i 1 {
                    continue;
                } continue; if ((i + 1) <= n && stairs[i + 1] == 0) {
                    route[i + 1] = (route[i] + route[i + 1]) % MOD;
                } (i + 1) <= n && stairs[i + 1] == 0 (i + 1) <= n (i + 1) i 1 n stairs[i + 1] == 0 stairs[i + 1] stairs i + 1 i 1 0 {
                    route[i + 1] = (route[i] + route[i + 1]) % MOD;
                } route[i + 1] = (route[i] + route[i + 1]) % MOD route[i + 1] route i + 1 i 1 (route[i] + route[i + 1]) % MOD (route[i] + route[i + 1]) route[i] route i route[i + 1] route i + 1 i 1 MOD if ((i + 2) <= n && stairs[i + 2] == 0) {
                    route[i + 2] = (route[i] + route[i + 2]) % MOD;
                } (i + 2) <= n && stairs[i + 2] == 0 (i + 2) <= n (i + 2) i 2 n stairs[i + 2] == 0 stairs[i + 2] stairs i + 2 i 2 0 {
                    route[i + 2] = (route[i] + route[i + 2]) % MOD;
                } route[i + 2] = (route[i] + route[i + 2]) % MOD route[i + 2] route i + 2 i 2 (route[i] + route[i + 2]) % MOD (route[i] + route[i + 2]) route[i] route i route[i + 2] route i + 2 i 2 MOD out.print(route[n] % MOD) out.print out route[n] % MOD route[n] route n MOD 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;
                if (stairs[step - 1] == 1) {
                    out.print(0);
                    return;
                }
            }

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

            if (n <= 1) {
                out.print(route[1]);
                return;
            }

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

            out.print(route[n] % MOD);

        }

    }
} 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;
                if (stairs[step - 1] == 1) {
                    out.print(0);
                    return;
                }
            }

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

            if (n <= 1) {
                out.print(route[1]);
                return;
            }

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

            out.print(route[n] % MOD);

        }

    }
} 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;
                if (stairs[step - 1] == 1) {
                    out.print(0);
                    return;
                }
            }

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

            if (n <= 1) {
                out.print(route[1]);
                return;
            }

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

            out.print(route[n] % MOD);

        }

    }
}

