#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <map>
#include <set>
#include <list>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
#include <limits>

using namespace std;

using i64 = long long int;
using u64 = std::uint_fast64_t;
using P = pair<i64, i64>;

struct edge {
    i64 from, to, cost;
    edge(i64 from, i64 to) : from(from), to(to), cost(1) {}
    edge(i64 from, i64 to, i64 cost) : from(from), to(to), cost(cost) {}
};
using Graph = vector<vector<edge>>;

constexpr i64 SINF = std::numeric_limits<i64>::max() / 10;
const i64 MOD = 1000000007;
const i64 dx[4] = { 0,1,0,-1 }, dy[4] = { -1,0,1,0 };
//const i64 dx[5] = {-1,0,0,0,1}, dy[5] = {0,-1,0,1,0};
//const i64 dx[8] = {-1,0,1,1,1,0,-1,-1}, dy[8] = {1,1,1,0,-1,-1,-1,0};
//const i64 dx[9] = {-1,0,1,1,1,0,-1,-1,0}, dy[9] = {1,1,1,0,-1,-1,-1,0,0};

// http://beet-aizu.hatenablog.com/entry/2018/04/08/145516
template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }

template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}

template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }

template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
    for (auto& e : t) fill_v(e, v);
}

struct IoSetup {
    IoSetup() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(10);
        cerr << fixed << setprecision(10);
    }
} iosetup;

template<std::uint_fast64_t mod=1000000007>
class Modint {
    using u64 = std::uint_fast64_t;
public:
    u64 a;
    constexpr Modint(u64 x = 0) {
       a = x % mod;
    }
    constexpr Modint(const Modint& rhs) {
        a = rhs.a;
    }
    constexpr u64 &value() noexcept { 
        return a;
    }
    constexpr const u64 &value() const noexcept { 
        return a;
    }
    constexpr Modint &operator =(const Modint& rhs){
        a = rhs.a;
        return *this;
    }
    constexpr Modint operator +(const Modint &rhs) const noexcept {
        return Modint(*this) += rhs;
    }
    constexpr Modint operator +(const u64& rhs) const noexcept {
        return Modint(*this) += Modint<mod>(rhs);
    }
    constexpr Modint operator -(const Modint& rhs) const noexcept {
        return Modint(*this) -= rhs;
    }
    constexpr Modint operator -(const u64& rhs) const noexcept {
        return Modint(*this) -= Modint<mod>(rhs);
    }
    constexpr Modint operator *(const Modint& rhs) const noexcept {
        return Modint(*this) *= rhs; 
    }
    constexpr Modint operator *(const u64& rhs) const noexcept {
        return Modint(*this) *= Modint<mod>(rhs);
    }
    constexpr Modint operator /(const Modint& rhs) const noexcept {
        return Modint(*this) /= rhs;
    }
    constexpr Modint operator /(const u64& rhs) const noexcept {
        return Modint(*this) /= Modint<mod>(rhs);
    }
    constexpr bool operator ==(const Modint& rhs) const noexcept {
        return a == rhs.a;
    }
    constexpr bool operator !=(const Modint& rhs) const noexcept {
        return a != rhs.a;
    }
    constexpr Modint& operator +=(const Modint& rhs) noexcept {
        a += rhs.a;
        if (a >= mod) a -= mod;
        return *this;
    }
    constexpr Modint& operator -=(const Modint& rhs) noexcept {
        if (a < rhs.a) a += mod;
        a -= rhs.a;
        return *this;
    }
    constexpr Modint& operator *=(const Modint& rhs) noexcept {
        a = a * rhs.a % mod;
        return *this;
    }
    constexpr Modint& operator/=(Modint rhs) noexcept {
        a = (Modint(*this) * rhs.inv()).a;
		return *this;
    }
    constexpr Modint& operator++() noexcept {
        *this += 1;
        return *this;
    }
    constexpr Modint& operator--() noexcept {
        *this -= 1;
        return *this;
    }
    constexpr Modint pow(u64 n) noexcept {
        Modint<mod> r = 1;
        while (n > 0) {
            if(n & 1){
                r *= a;
            }
            a *= a;
            n >>= 1;
        }
        return r;
    }
    constexpr Modint inv() noexcept {
        return Modint(*this).pow(mod - 2);
    }
};

using mint = Modint<>;

istream& operator>>(istream& os, mint& x) {
    u64 a;
    os >> a;
    x = mint(a);
    return os;
}

ostream& operator<<(ostream& os, const mint& m) noexcept {
    return os << m.a;
}

int main() {
    i64 n, m;
    cin >> n >> m;
    vector<bool> b(n + 1, false);
    for (int i = 0; i < m; ++i) {
        i64 a;
        cin >> a;
        b[a] = true;
    }
    vector<mint> dp(n + 1, 0);
    dp[0] = 1;
    for (int i = 0; i < n; ++i) {
        if (b[i]) continue;
        if (!b[i + 1]) dp[i + 1] = dp[i] + dp[i + 1];
        if (i != n - 1 && !b[i + 2]) dp[i + 2] = dp[i] + dp[i + 2];
    }
    cout << dp[n] << endl;
}

Measured memory_bytes: 1024