#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
long long MOD = 1000000000 + 7;
constexpr long long INF = numeric_limits<LL>::max();
constexpr long long DINF = 1000000000000;
const double PI = acos(-1);
struct Tll {
  LL first, second, third;
};
struct Fll {
  LL first, second, third, fourth;
};
void YN(bool f) {
  if (f)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
void yn(bool f) {
  if (f)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
struct Edge {
  LL to, cost;
};
struct edge {
  LL from, to, cost;
};
vector<vector<Edge>> g;
vector<edge> ed;
vector<pair<LL, LL>> pv;
map<LL, LL> ma;
set<LL> st;
int di[4][2] = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}};
LL n, m, k, p, q, w, h, s, t, ans, cnt, sum, a[210000], dp[210000];
string str;
bool f[110000];
int main() {
  cin >> n >> m;
  for (LL i = 0; i < m; i++) {
    cin >> a[i];
    f[a[i]] = 1;
  }
  dp[0] = 1;
  for (LL i = 0; i < n + 1; i++) {
    if (f[i] == 0) dp[i + 1] += dp[i];
    if (f[i + 1] == 0) dp[i + 2] += dp[i];
    dp[i + 1] %= MOD;
    dp[i + 2] %= MOD;
  }
  cout << dp[n + 1] << endl;
  return 0;
}
