#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
ll mod = 1000000007;
int main(int argc, char const *argv[]) {
  int n, m;
  std::cin >> n >> m;
  int dis_max = 0;
  if (m == 0) {
    dis_max = n;
  }
  std::vector<int> a;
  a.push_back(-1);
  for (size_t i = 0; i < m; i++) {
    int tmp;
    std::cin >> tmp;
    dis_max = max(dis_max, tmp - a.back() - 2);
    if (tmp - a.back() == 1) {
      for (size_t j = i + 1; j < m; j++) {
        std::cin >> tmp;
      }
      std::cout << 0 << '\n';
      return 0;
    }
    a.push_back(tmp);
  }
  a.push_back(n + 1);
  ll ans = 1;
  std::vector<ll> dp = {1, 1, 2};
  for (ll i = 3; i < dis_max + 10; i++) {
    dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
  }
  for (size_t i = 1; i < a.size(); i++) {
    ans = ((ans % mod) * (dp[a[i] - a[i - 1] - 2] % mod)) % mod;
  }
  std::cout << ans << '\n';
  return 0;
}
