import java.util.Scanner;

class Main {
    static final long mod = 1000000007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int a[] = new int[m];
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
        }
        sc.close();

        for (int i = 1; i < m; i++) {
            if (a[i] - a[i - 1] == 1) {
                System.out.println(0);
                return;
            }
        }
        long dp[] = new long[n + 2];
        dp[1] = 1;
        dp[2] = 1;
        for (int i = 3; i < n + 2; i++) {
            dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
        }
        if (m == 0) {
            System.out.println(dp[n + 1]);
            return;
        }
        long ans = 1;
        ans *= dp[a[0]];
        for (int i = 1; i < m; i++) {
            ans *= dp[a[i] - a[i - 1] - 1];
            ans %= mod;
        }
        ans *= dp[n - a[m - 1]];
        ans %= mod;
        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util class Main {
    static final long mod = 1000000007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int a[] = new int[m];
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
        }
        sc.close();

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

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

        for (int i = 1; i < m; i++) {
            if (a[i] - a[i - 1] == 1) {
                System.out.println(0);
                return;
            }
        }
        long dp[] = new long[n + 2];
        dp[1] = 1;
        dp[2] = 1;
        for (int i = 3; i < n + 2; i++) {
            dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
        }
        if (m == 0) {
            System.out.println(dp[n + 1]);
            return;
        }
        long ans = 1;
        ans *= dp[a[0]];
        for (int i = 1; i < m; i++) {
            ans *= dp[a[i] - a[i - 1] - 1];
            ans %= mod;
        }
        ans *= dp[n - a[m - 1]];
        ans %= mod;
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc 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 for (int i = 1; i < m; i++) {
            if (a[i] - a[i - 1] == 1) {
                System.out.println(0);
                return;
            }
        } int i = 1; int i = 1; i 1 i < m i m i++ i++ i {
            if (a[i] - a[i - 1] == 1) {
                System.out.println(0);
                return;
            }
        } {
            if (a[i] - a[i - 1] == 1) {
                System.out.println(0);
                return;
            }
        } if (a[i] - a[i - 1] == 1) {
                System.out.println(0);
                return;
            } a[i] - a[i - 1] == 1 a[i] - a[i - 1] a[i] a i a[i - 1] a i - 1 i 1 1 {
                System.out.println(0);
                return;
            } System.out.println(0) System.out.println System.out System System.out 0 return; long dp[] = new long[n + 2]; dp new long[n + 2] n + 2 n 2 dp[1] = 1 dp[1] dp 1 1 dp[2] = 1 dp[2] dp 2 1 for (int i = 3; i < n + 2; i++) {
            dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
        } int i = 3; int i = 3; i 3 i < n + 2 i n + 2 n 2 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 if (m == 0) {
            System.out.println(dp[n + 1]);
            return;
        } m == 0 m 0 {
            System.out.println(dp[n + 1]);
            return;
        } System.out.println(dp[n + 1]) System.out.println System.out System System.out dp[n + 1] dp n + 1 n 1 return; long ans = 1; ans 1 ans *= dp[a[0]] ans dp[a[0]] dp a[0] a 0 for (int i = 1; i < m; i++) {
            ans *= dp[a[i] - a[i - 1] - 1];
            ans %= mod;
        } int i = 1; int i = 1; i 1 i < m i m i++ i++ i {
            ans *= dp[a[i] - a[i - 1] - 1];
            ans %= mod;
        } {
            ans *= dp[a[i] - a[i - 1] - 1];
            ans %= mod;
        } ans *= dp[a[i] - a[i - 1] - 1] ans dp[a[i] - a[i - 1] - 1] dp a[i] - a[i - 1] - 1 a[i] - a[i - 1] - 1 a[i] a i a[i - 1] a i - 1 i 1 1 ans %= mod ans mod ans *= dp[n - a[m - 1]] ans dp[n - a[m - 1]] dp n - a[m - 1] n a[m - 1] a m - 1 m 1 ans %= mod ans mod System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.Scanner;

class Main {
    static final long mod = 1000000007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int a[] = new int[m];
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
        }
        sc.close();

        for (int i = 1; i < m; i++) {
            if (a[i] - a[i - 1] == 1) {
                System.out.println(0);
                return;
            }
        }
        long dp[] = new long[n + 2];
        dp[1] = 1;
        dp[2] = 1;
        for (int i = 3; i < n + 2; i++) {
            dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
        }
        if (m == 0) {
            System.out.println(dp[n + 1]);
            return;
        }
        long ans = 1;
        ans *= dp[a[0]];
        for (int i = 1; i < m; i++) {
            ans *= dp[a[i] - a[i - 1] - 1];
            ans %= mod;
        }
        ans *= dp[n - a[m - 1]];
        ans %= mod;
        System.out.println(ans);
    }
}
