#include <bits/stdc++.h>
using namespace std;
constexpr auto INF = 1000000000;
constexpr auto LLINF = 1LL << 62;
constexpr auto mod = 1000000007;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int f[1000000] = {};
int fib(int i) {
  if (i < 2) return f[i];
  if (f[i] != 0) return f[i];
  return f[i] = (fib(i - 1) + fib(i - 2));
}
int main() {
  f[0] = 0;
  f[1] = 1;
  int n, m;
  cin >> n >> m;
  vector<int> a(m + 2);
  a[0] = -1;
  for (int(i) = 1; (i) <= (m); (i)++) cin >> a[i];
  a[m + 1] = n + 1;
  long long ans = 1;
  vector<int> b;
  for (int(i) = 0; (i) < (m + 1); (i)++) {
    if (a[i + 1] - a[i] == 1) {
      cout << 0 << endl;
      return 0;
    }
    if (a[i + 1] - a[i]) b.push_back(a[i + 1] - a[i] - 1);
  }
  for (int i : b) {
    ans *= fib(i);
    ans %= mod;
  }
  cout << ans << endl;
}
