#include <bits/stdc++.h>
using ll = long long;
using ld = long double;
constexpr ll inf = static_cast<ll>(1e17);
constexpr ll mod = static_cast<ll>(1e9 + 7);
int n, m;
std::map<int, bool> mp;
ll dp[100005];
int main() {
  std::cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int a;
    std::cin >> a;
    mp[a] = true;
  }
  bool check = true;
  dp[0] = 1;
  while (check) {
    check = false;
    for (int i = n - 1; i >= 0; --i) {
      if (dp[i] != 0) check = true;
      if (mp.count(i + 1) != 1) dp[i + 1] = (dp[i + 1] + dp[i]) % mod;
      if (mp.count(i + 2) != 1) dp[i + 2] = (dp[i + 2] + dp[i]) % mod;
      dp[i] = 0;
    }
  }
  std::cout << dp[n] << std::endl;
  return 0;
}
