#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
const ll INF = 1LL << 60;
int n, m, a[100000];
ll h[100010];
ll dp[100010];
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; ++i) cin >> a[i];
  for (int i = 0; i < 100010; ++i) dp[i] = 0;
  dp[0] = 1;
  int j = 0;
  for (int i = 1; i <= n; ++i) {
    if (i == a[j]) {
      j++;
      continue;
    }
    dp[i] += dp[i - 1];
    if (i > 1) dp[i] += dp[i - 2];
  }
  cout << dp[n] % 1000000007;
}
