#include <bits/stdc++.h>
using ll = long long;
using vint = std::vector<int>;
constexpr int mod = 1e9 + 7;
class mint {
 private:
  std::int64_t m_x;

 public:
  mint(int64_t m_x = 0) : m_x(m_x % mod) {}
  mint &operator+=(const mint a) {
    if ((m_x += a.m_x) >= mod) m_x -= mod;
    return *this;
  }
  mint &operator-=(const mint a) {
    if ((m_x += mod - a.m_x) >= mod) m_x -= mod;
    return *this;
  }
  mint &operator*=(const mint a) {
    (m_x *= a.m_x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res *= a;
  }
  std::int64_t get() { return m_x; }
};
void Main() {
  int n, m;
  std::cin >> n >> m;
  vint a(m);
  for (auto &ai : a) {
    std::cin >> ai;
  }
  std::vector<mint> dp(n + 1, 0);
  dp[0] = 1;
  dp[1] = 1;
  auto itr = a.begin();
  if (*itr == 1) {
    dp[1] = 0;
    ++itr;
  }
  for (int i = 2; i <= n; ++i) {
    if (i == *itr) {
      dp[i] = 0;
      ++itr;
    } else {
      dp[i] = dp[i - 1] + dp[i - 2];
    }
  }
  std::cout << dp[n].get() << "\n";
}
int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  Main();
  return 0;
}
