import java.util.Arrays;
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int mod = 1000000007;
        int n = sc.nextInt();
        int m = sc.nextInt();
        long dp[] = new long[100100];
        Arrays.fill(dp, 0);
        dp[0] = 0;
        dp[1] = 0;
        dp[2] = 1;
        dp[3] = 1;
        dp[4] = 2;
        dp[5] = 3;
        for (int i = 6; i < 100100; i++) {
            dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
        }
        int a[] = new int[m];
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
        }
        sc.close();
        if (m == 0) {
            // System.out.println(n + 2);
            System.out.println(dp[n + 2]);
            return;
        }
        for (int i = 0; i < m - 1; i++) {
            int sa = a[i + 1] - a[i];
            if (sa == 1) {
                System.out.println(0);
                return;
            }
        }
        long ans = 1;
        ans *= dp[a[0] + 1];

        for (int i = 1; i < m; i++) {
            int sa = a[i] - a[i - 1];
            // System.out.println(sa);
            ans = ans * dp[sa] % mod;
        }
        ans = ans * dp[n + 1 - a[m - 1]] % mod;
        // System.out.println(n + 1 - a[m - 1]);
        /*
         * for (int i = 0; i < n; i++) { // System.out.println(dp[i]); }
         */

        System.out.println(ans);

    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int mod = 1000000007;
        int n = sc.nextInt();
        int m = sc.nextInt();
        long dp[] = new long[100100];
        Arrays.fill(dp, 0);
        dp[0] = 0;
        dp[1] = 0;
        dp[2] = 1;
        dp[3] = 1;
        dp[4] = 2;
        dp[5] = 3;
        for (int i = 6; i < 100100; i++) {
            dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
        }
        int a[] = new int[m];
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
        }
        sc.close();
        if (m == 0) {
            // System.out.println(n + 2);
            System.out.println(dp[n + 2]);
            return;
        }
        for (int i = 0; i < m - 1; i++) {
            int sa = a[i + 1] - a[i];
            if (sa == 1) {
                System.out.println(0);
                return;
            }
        }
        long ans = 1;
        ans *= dp[a[0] + 1];

        for (int i = 1; i < m; i++) {
            int sa = a[i] - a[i - 1];
            // System.out.println(sa);
            ans = ans * dp[sa] % mod;
        }
        ans = ans * dp[n + 1 - a[m - 1]] % mod;
        // System.out.println(n + 1 - a[m - 1]);
        /*
         * for (int i = 0; i < n; i++) { // System.out.println(dp[i]); }
         */

        System.out.println(ans);

    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int mod = 1000000007;
        int n = sc.nextInt();
        int m = sc.nextInt();
        long dp[] = new long[100100];
        Arrays.fill(dp, 0);
        dp[0] = 0;
        dp[1] = 0;
        dp[2] = 1;
        dp[3] = 1;
        dp[4] = 2;
        dp[5] = 3;
        for (int i = 6; i < 100100; i++) {
            dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
        }
        int a[] = new int[m];
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
        }
        sc.close();
        if (m == 0) {
            // System.out.println(n + 2);
            System.out.println(dp[n + 2]);
            return;
        }
        for (int i = 0; i < m - 1; i++) {
            int sa = a[i + 1] - a[i];
            if (sa == 1) {
                System.out.println(0);
                return;
            }
        }
        long ans = 1;
        ans *= dp[a[0] + 1];

        for (int i = 1; i < m; i++) {
            int sa = a[i] - a[i - 1];
            // System.out.println(sa);
            ans = ans * dp[sa] % mod;
        }
        ans = ans * dp[n + 1 - a[m - 1]] % mod;
        // System.out.println(n + 1 - a[m - 1]);
        /*
         * for (int i = 0; i < n; i++) { // System.out.println(dp[i]); }
         */

        System.out.println(ans);

    } main {
        Scanner sc = new Scanner(System.in);
        int mod = 1000000007;
        int n = sc.nextInt();
        int m = sc.nextInt();
        long dp[] = new long[100100];
        Arrays.fill(dp, 0);
        dp[0] = 0;
        dp[1] = 0;
        dp[2] = 1;
        dp[3] = 1;
        dp[4] = 2;
        dp[5] = 3;
        for (int i = 6; i < 100100; i++) {
            dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
        }
        int a[] = new int[m];
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
        }
        sc.close();
        if (m == 0) {
            // System.out.println(n + 2);
            System.out.println(dp[n + 2]);
            return;
        }
        for (int i = 0; i < m - 1; i++) {
            int sa = a[i + 1] - a[i];
            if (sa == 1) {
                System.out.println(0);
                return;
            }
        }
        long ans = 1;
        ans *= dp[a[0] + 1];

        for (int i = 1; i < m; i++) {
            int sa = a[i] - a[i - 1];
            // System.out.println(sa);
            ans = ans * dp[sa] % mod;
        }
        ans = ans * dp[n + 1 - a[m - 1]] % mod;
        // System.out.println(n + 1 - a[m - 1]);
        /*
         * for (int i = 0; i < n; i++) { // System.out.println(dp[i]); }
         */

        System.out.println(ans);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int mod = 1000000007; mod 1000000007 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc long dp[] = new long[100100]; dp new long[100100] 100100 Arrays.fill(dp, 0) Arrays.fill Arrays dp 0 dp[0] = 0 dp[0] dp 0 0 dp[1] = 0 dp[1] dp 1 0 dp[2] = 1 dp[2] dp 2 1 dp[3] = 1 dp[3] dp 3 1 dp[4] = 2 dp[4] dp 4 2 dp[5] = 3 dp[5] dp 5 3 for (int i = 6; i < 100100; i++) {
            dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
        } int i = 6; int i = 6; i 6 i < 100100 i 100100 i++ i++ i {
            dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
        } {
            dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
        } dp[i] = (dp[i - 1] + dp[i - 2]) % mod dp[i] dp i (dp[i - 1] + dp[i - 2]) % mod (dp[i - 1] + dp[i - 2]) dp[i - 1] dp i - 1 i 1 dp[i - 2] dp i - 2 i 2 mod int a[] = new int[m]; a new int[m] m for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            a[i] = sc.nextInt();
        } {
            a[i] = sc.nextInt();
        } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc sc.close() sc.close sc if (m == 0) {
            // System.out.println(n + 2);
            System.out.println(dp[n + 2]);
            return;
        } m == 0 m 0 {
            // System.out.println(n + 2);
            System.out.println(dp[n + 2]);
            return;
        } System.out.println(dp[n + 2]) System.out.println System.out System System.out dp[n + 2] dp n + 2 n 2 return; for (int i = 0; i < m - 1; i++) {
            int sa = a[i + 1] - a[i];
            if (sa == 1) {
                System.out.println(0);
                return;
            }
        } int i = 0; int i = 0; i 0 i < m - 1 i m - 1 m 1 i++ i++ i {
            int sa = a[i + 1] - a[i];
            if (sa == 1) {
                System.out.println(0);
                return;
            }
        } {
            int sa = a[i + 1] - a[i];
            if (sa == 1) {
                System.out.println(0);
                return;
            }
        } int sa = a[i + 1] - a[i]; sa a[i + 1] - a[i] a[i + 1] a i + 1 i 1 a[i] a i if (sa == 1) {
                System.out.println(0);
                return;
            } sa == 1 sa 1 {
                System.out.println(0);
                return;
            } System.out.println(0) System.out.println System.out System System.out 0 return; long ans = 1; ans 1 ans *= dp[a[0] + 1] ans dp[a[0] + 1] dp a[0] + 1 a[0] a 0 1 for (int i = 1; i < m; i++) {
            int sa = a[i] - a[i - 1];
            // System.out.println(sa);
            ans = ans * dp[sa] % mod;
        } int i = 1; int i = 1; i 1 i < m i m i++ i++ i {
            int sa = a[i] - a[i - 1];
            // System.out.println(sa);
            ans = ans * dp[sa] % mod;
        } {
            int sa = a[i] - a[i - 1];
            // System.out.println(sa);
            ans = ans * dp[sa] % mod;
        } int sa = a[i] - a[i - 1]; sa a[i] - a[i - 1] a[i] a i a[i - 1] a i - 1 i 1 ans = ans * dp[sa] % mod ans ans * dp[sa] % mod ans * dp[sa] ans dp[sa] dp sa mod ans = ans * dp[n + 1 - a[m - 1]] % mod ans ans * dp[n + 1 - a[m - 1]] % mod ans * dp[n + 1 - a[m - 1]] ans dp[n + 1 - a[m - 1]] dp n + 1 - a[m - 1] n + 1 n 1 a[m - 1] a m - 1 m 1 mod System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.Arrays;
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int mod = 1000000007;
        int n = sc.nextInt();
        int m = sc.nextInt();
        long dp[] = new long[100100];
        Arrays.fill(dp, 0);
        dp[0] = 0;
        dp[1] = 0;
        dp[2] = 1;
        dp[3] = 1;
        dp[4] = 2;
        dp[5] = 3;
        for (int i = 6; i < 100100; i++) {
            dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
        }
        int a[] = new int[m];
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
        }
        sc.close();
        if (m == 0) {
            // System.out.println(n + 2);
            System.out.println(dp[n + 2]);
            return;
        }
        for (int i = 0; i < m - 1; i++) {
            int sa = a[i + 1] - a[i];
            if (sa == 1) {
                System.out.println(0);
                return;
            }
        }
        long ans = 1;
        ans *= dp[a[0] + 1];

        for (int i = 1; i < m; i++) {
            int sa = a[i] - a[i - 1];
            // System.out.println(sa);
            ans = ans * dp[sa] % mod;
        }
        ans = ans * dp[n + 1 - a[m - 1]] % mod;
        // System.out.println(n + 1 - a[m - 1]);
        /*
         * for (int i = 0; i < n; i++) { // System.out.println(dp[i]); }
         */

        System.out.println(ans);

    }
}