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

template <typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
    os << "{";
    for (int i = 0; i < (int)vec.size(); ++i) {
        os << vec[i] << (i + 1 == (int)vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, pair<T, U>& pair_var) {
    os << "(" << pair_var.first << ", " << pair_var.second << ")";
    return os;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, map<T, U>& map_var) {
    os << "{";
    for (auto itr = map_var.begin(); itr != map_var.end(); itr++) {
        os << "(" << itr->first << ", " << itr->second << ")";
        itr++;
        if (itr != map_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
template <typename T>
ostream& operator<<(ostream& os, set<T>& set_var) {
    os << "{";
    for (auto itr = set_var.begin(); itr != set_var.end(); itr++) {
        os << *itr;
        ++itr;
        if (itr != set_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
void dump_func() {
    cerr << "\n";
}
template <class Head, class... Tail>
void dump_func(Head&& head, Tail&&... tail) {
    cerr << head;
    if (sizeof...(Tail) == 0) {
        cerr << " ";
    } else {
        cerr << ", ";
    }
    dump_func(std::move(tail)...);
}
#define dump(...) cerr << "[" << to_string(__LINE__) << "]"        \
                       << "    " << string(#__VA_ARGS__) << " = ", \
                  dump_func(__VA_ARGS__)

using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<double>;
using VVI = vector<VI>;
using VVL = vector<VL>;
using PI = pair<int, int>;
using PL = pair<ll, ll>;
using VPI = vector<PI>;
using VPL = vector<PL>;
using VS = vector<string>;

#define ln '\n'
#define REP(t, n) for (int t = 0; t < (n); ++t)
#define FOR(t, a, b) for (int t = (a); t <= (b); ++t)
#define FORR(t, a, b) for (int t = (a); t >= (b); --t)
#define ALL(c) (c).begin(), (c).end()
#define CAUTO const auto&

ll mo = 1000000007;
ll fib(ll k, ll a1 = 1, ll a2 = 1) {
    if (k == 0) return 0;
    if (k == 1) return a1;
    if (k == 2) return a2;
    k -= 2;
    ll R[2][2] = {{1, 0}, {0, 1}};
    ll A[2][2] = {{1, 1}, {1, 0}};

    while (k) {
        if (k % 2) {
            ll S[2][2];
            S[0][0] = (A[0][0] * R[0][0] + A[0][1] * R[1][0]) % mo;
            S[0][1] = (A[0][0] * R[0][1] + A[0][1] * R[1][1]) % mo;
            S[1][0] = (A[1][0] * R[0][0] + A[1][1] * R[1][0]) % mo;
            S[1][1] = (A[1][0] * R[0][1] + A[1][1] * R[1][1]) % mo;
            swap(S, R);
        }
        ll T[2][2];
        T[0][0] = (A[0][0] * A[0][0] + A[0][1] * A[1][0]) % mo;
        T[0][1] = (A[0][0] * A[0][1] + A[0][1] * A[1][1]) % mo;
        T[1][0] = (A[1][0] * A[0][0] + A[1][1] * A[1][0]) % mo;
        T[1][1] = (A[1][0] * A[0][1] + A[1][1] * A[1][1]) % mo;
        swap(T, A);
        k >>= 1;
    }
    return (R[0][0] + R[0][1]) % mo;
}

ll seq_pattern(ll n) {
    return fib(n, 1, 1);
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, m;
    cin >> n >> m;
    VL skip(m);
    REP(i, m) {
        cin >> skip[i];
    }
    skip.emplace_back(n + 1);
    ll ans = 1;
    ll old = -1;
    REP(i, m + 1) {
        if (skip[i] == 1) {
            old = 1;
            continue;
        }
        if (skip[i] - old - 1 == 0) {
            ans = 0;
            break;
        }
        // cerr << skip[i] - old - 1 << ln;
        // cerr << seq_pattern(skip[i] - old - 1) << ln;
        ans = (ans * seq_pattern(skip[i] - old - 1)) % mo;
        old = skip[i];
    }
    cout << ans << ln;

    return 0;
}


Measured memory_bytes: 1792