#include <bits/stdc++.h>
using namespace std;
static const long long MAX = 1000000;
static const long long INFTY = 1e12;
static const long long MOD = 1000000007;
template <typename T>
inline string toString(const T &a) {
  ostringstream oss;
  oss << a;
  return oss.str();
};
struct edge {
  long long to, cost;
};
using Graph = vector<vector<int>>;
using _Graph = vector<vector<edge>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
vector<bool> seen;
vector<int> colors;
int H, W, N;
int sx, sy, gx, gy;
vector<vector<char>> field;
vector<vector<int>> dist;
deque<pair<int, int>> que;
const int INF = 100000000;
int main() {
  long long N, M;
  cin >> N >> M;
  vector<long long> a(M);
  for (int i = 0, i_len = (M); i < i_len; ++i) cin >> a[i];
  long long dp[100010] = {0};
  dp[0] = 1;
  dp[1] = 1;
  long long count = 0;
  if (a[0] == 1) {
    dp[1] = 0;
    count++;
  }
  for (int i = 0, i_len = (N + 1); i < i_len; ++i) {
    if (i > 1) {
      if (i == a[count]) {
        dp[i] = 0;
        count++;
      } else {
        dp[i] = dp[i - 1] + dp[i - 2];
        dp[i] %= MOD;
      }
    }
  }
  dp[N] %= MOD;
  cout << dp[N] << endl;
}
