#include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <sstream>
#include <stack>
#include <map>
#include <set>
#include <ios>
#include <cctype>
#include <cstdio>

#define REP(i,a) for(int i = 0;i < (a);++i)
#define FOR(i,a,b) for(int i = (a);i < (b); ++i)
#define FORR(i,a,b) for(int i = (b) - 1;i >=a;--i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SIZE(obj) (int)(obj).size()
#define MAX(list) std::max(list)
#define MIN(list) std::min(list)
#define YESNO(cond,yes,no){cout <<((cond)?(yes):(no))<<endl; }
#define SORT(list) sort(ALL((list)));
#define RSORT(list) sort((list).rbegin(),(list).rend())

using namespace std;

template<typename T>
T round_up(const T& a, const T& b) {
    return (a + (b - 1)) / b;
}

template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& p) {
    is >> p.first >> p.second;
    return is;
}

template <typename T1, typename T2>
ostream& operator<<(ostream& os, pair<T1, T2>& p) {
    os << p.first << p.second;
    return os;
}

template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
    REP(i, (int)v.size())is >> v[i];
    return is;
}

template <typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
    REP(i, (int)v.size())os << v[i] << endl;
    return os;
}


using ll = long long;
constexpr int mod = 1'000'000'007;
constexpr int INF = 1'050'000'000;

int clamp(int n, int a, int b) {
    if (n < a)n = a;
    if (n > b)n = b;
    return n;
}

int Fib[100001];

int fib(int N) {
    if (Fib[N] > 0)return Fib[N];
    if (N == 0 || N == 1)return Fib[N] = 1;
    return Fib[N] = (fib(N - 1) + fib(N - 2)) % mod;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    std::cout << fixed << setprecision(20);

    int N, M;
    cin >> N >> M;
    vector<int>A(M);
    cin >> A;
    bool can = true;
    REP(i, M - 1) {
        if (A[i + 1] - A[i] == 1)can = false;
    }
    if (!can) {
        cout << 0 << endl;
        return 0;
    }

    if (M == 0) {
        cout << fib(N + 1) << endl;
        return 0;
    }
    A.emplace_back(-1);
    A.emplace_back(N + 1);
    SORT(A);
    ll ans = 1;
    REP(i, M + 1) {
        ans *= fib(A[i + 1] - A[i] - 2);
        ans %= mod;
    }

    cout << ans << endl;

    return 0;

}