#include <bits/stdc++.h>
using namespace std;
constexpr int MOD = 1000000007;
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
void print(const std::vector<int> &v) {
  std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
  std::cout << std::endl;
}
long long stepup(long long step) {
  if (step < 0) return 0;
  if (step == 0) {
    return 0;
  }
  if (step == 1) {
    return 1;
  } else if (step == 2) {
    return 2;
  } else {
    long long s = stepup(step - 1) % MOD;
    s += stepup(step - 2) % MOD;
    s % MOD;
    return s;
  }
}
int main() {
  long long N, M;
  cin >> N >> M;
  vector<long long> broken(M);
  for (long long i = 0; i < (long long)M; i++) {
    cin >> broken[i];
  }
  broken.push_back(N + 1);
  long long ans;
  if (broken[0] - 1 != 0) {
    ans = stepup(broken[0] - 1);
  } else {
    ans = 1;
  }
  for (long long i = 0; i < (long long)M; i++) {
    int tmp = broken[i + 1] - broken[i] - 2;
    ans *= stepup(tmp);
    ans %= MOD;
  }
  ans %= MOD;
  cout << ans << endl;
}
