#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
template <typename T>
void putv(vector<T>& V) {
  for (auto x : V) cout << x << " ";
  cout << endl;
}
long long pow_mod(long long fi, long long se, long long mod) {
  if (se == 0) {
    return 1;
  }
  if (se % 2) {
    return pow_mod(fi, se - 1, mod) * fi % mod;
  }
  long long t = pow_mod(fi, se / 2, mod);
  return t * t % mod;
}
template <class T>
vector<T> getv(long long n) {
  vector<T> Vector_temp;
  for (int(i) = 0; (i) < (n); (i)++) {
    T input;
    cin >> input;
    Vector_temp.emplace_back(input);
  }
  return Vector_temp;
}
long long gcd(long long c, long long b) {
  while (1) {
    if (c % b != 0) {
      long long tmp = b;
      b = c % b;
      c = tmp;
    } else {
      return b;
    }
  }
}
vector<pair<int, int>> Dir = {{-1, 0}, {1, 0}, {0, 1}, {0, -1}};
long long dp[100002];
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> a((m), 0);
  ;
  for (int(i) = 0; (i) < (m); (i)++) {
    cin >> a[i];
    dp[a[i]] = -1;
  }
  dp[0] = 1;
  for (int(i) = 0; (i) < (n + 1); (i)++) {
    if (dp[i] >= 0) {
      if (dp[i + 1] >= 0) {
        dp[i + 1] += dp[i];
        dp[i + 1] %= MOD;
      }
      if (dp[i + 2] >= 0) {
        dp[i + 2] += dp[i];
        dp[i + 2] %= MOD;
      }
    }
  }
  cout << (dp[n]) << endl;
  ;
  return 0;
}
