#include <bits/stdc++.h>
using ull = unsigned long long;
constexpr auto mod = 1000000007;
constexpr auto INF = ULLONG_MAX;
using namespace std;
template <typename T>
inline void dump(const T& x) {
  cout << "[" << x << "]" << endl;
}
template <typename T>
inline void dump(const vector<T>& x) {
  for (const auto v : x) {
    cout << v << " ";
  }
  cout << endl;
}
template <typename T>
inline void sort_asc(vector<T>& x) {
  std::sort(x.begin(), x.end());
}
template <typename T>
inline void sort_desc(vector<T>& x) {
  std::sort(x.begin(), x.end(), greater<T>());
}
template <typename T>
inline T max_value(vector<T>& x) {
  return *max_element(x.begin(), x.end());
}
template <typename T>
inline T min_value(vector<T>& x) {
  return *min_element(x.begin(), x.end());
}
template <typename T>
inline T sum_value(vector<T>& x) {
  return accumulate(x.begin(), x.end(), 0ULL);
}
int main() {
  ull n, m;
  cin >> n >> m;
  vector<ull> a;
  for (auto i = 0; i < m; i++) {
    ull tmp;
    cin >> tmp;
    a.emplace_back(tmp);
  }
  vector<ull> dp(n + 1, 0);
  ull index = 0;
  for (ull i = 0; i < n; i++) {
    if ((i + 1) == a[index]) {
      dp[i] = 0;
      index++;
    } else {
      if (i == 0) {
        dp[0] = 1;
      } else if (i == 1) {
        if (dp[0] == 0) {
          dp[1] = 1;
        } else {
          dp[1] = 2;
        }
      } else {
        dp[i] = (dp[i - 1] % mod) + (dp[i - 2] % mod);
      }
    }
  }
  cout << dp[n - 1] % mod << endl;
  return 0;
}
