#include <bits/stdc++.h>
using namespace std;

template <const long long M>
class mint {
   private:
    long long x;

   public:
    constexpr mint(long long x = 0) : x((x % M + M) % M) {}
    constexpr long long value() { return x; }
    constexpr mint operator-() const { return mint(-x); }
    constexpr mint &operator+=(const mint &a) {
        if ((x += a.x) >= M) x -= M;
        return *this;
    }
    constexpr mint &operator-=(const mint &a) {
        if ((x += M - a.x) >= M) x -= M;
        return *this;
    }
    constexpr mint &operator*=(const mint &a) {
        (x *= a.x) %= M;
        return *this;
    }
    constexpr mint &operator/=(const mint &a) { return (*this) *= a.inv(); }
    constexpr mint operator+(const mint &a) const {
        mint res(*this);
        return res += a;
    }
    constexpr mint operator-(const mint &a) const {
        mint res(*this);
        return res -= a;
    }
    constexpr mint operator*(const mint &a) const {
        mint res(*this);
        return res *= a;
    }
    constexpr mint operator/(const mint &a) const {
        mint res(*this);
        return res /= a;
    }
    constexpr mint pow(long long t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }
    constexpr mint inv() const { return pow(M - 2); }
    constexpr bool operator==(const mint &a) const { return x == a.x; }
    constexpr bool operator!=(const mint &a) const { return x != a.x; }
    friend istream &operator>>(istream &in, mint &a) {
        in >> a.x;
        if (a.x < 0) a.x += M;
        a.x %= M;
        return in;
    }
    friend ostream &operator<<(ostream &out, const mint &a) {
        out << a.x;
        return out;
    }
};

template <typename T>
T combination(int n, int r) {
    T ans = 1;
    for (int i = 0; i < r; i++) {
        ans *= n - i;
        ans /= (i + 1);
    }
    return ans;
}

mint<1000000007> cntways(int x) {
    mint<1000000007> ret = 0;
    for (int i = 0; 2 * i <= x; i++) {
        ret += combination<mint<1000000007>>(x - i, i);
    }
    return ret;
}

int main() {
    int N, M;
    cin >> N >> M;
    vector<bool> A(N + 1, false);
    for (int i = 1; i <= M; i++) {
        int a;
        cin >> a;
        A[a] = true;
    }
    mint<1000000007> ans;
    if (A[N] == true) {
        cout << ans << endl;
        return 0;
    }
    for (int i = 0; i < N; i++) {
        if (A[i] == true && A[i + 1] == true) {
            cout << ans << endl;
            return 0;
        }
    }
    ans = 1;
    int cnt = 0;
    for (int i = 0; i <= N; i++) {
        if(A[i + 1] == true || i == N) {
            ans *= cntways(cnt); 
            cnt = 0;
            i++;
        } else {
            cnt++;
        }
    }
    cout << ans << endl;    
    return 0;
}
