#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
int former(const vector<T> &v, T x) {
  return upper_bound(v.begin(), v.end(), x) - v.begin() - 1;
}
template <class T>
int latter(const vector<T> &v, T x) {
  return lower_bound(v.begin(), v.end(), x) - v.begin();
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
const long long LLINF = 1LL << 60;
const int INF = 1 << 29;
const int MAX = 510000;
const int MOD = 1000000007;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
long long dp[100100];
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  vector<long long> a(m);
  for (long long i = 0, i_len = (m); i < i_len; ++i) {
    cin >> a[i];
    dp[a[i]] = -1;
  }
  dp[0] = 0;
  for (long long i = 0, i_len = (n); i < i_len; ++i) {
    if (dp[i] == -1) continue;
    if (dp[i + 1] != -1) {
      dp[i + 1] = max(dp[i + 1], dp[i] + 1);
      dp[i + 1] %= MOD;
    }
    if (dp[i + 2] != -1) {
      if (dp[i + 1] != -1) dp[i + 2] = max(dp[i + 2], dp[i + 1] + 1);
      dp[i + 2] = max(dp[i + 2], dp[i] + 1);
      dp[i + 2] %= MOD;
    }
  }
  cout << dp[n] << endl;
}
