#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int MAX = 10000000;
template <typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int n, m;
  cin >> n >> m;
  std::vector<long long> a(m);
  for (int i = 0; i < (int)(m); i++) {
    cin >> a[i];
    if (a[i] == a[i - 1] + 1 && i != 0) {
      cout << 0 << endl;
      return 0;
    }
  }
  std::vector<long long> s(n + 1);
  s[0] = 1;
  s[1] = 1;
  for (int i = (2); i < (int)(n + 1); i++) {
    s[i] = s[i - 1] + s[i - 2];
  }
  long long ans;
  ans += s[a[0] - 1];
  ans %= MOD;
  for (int i = (1); i < (int)(m); i++) {
    ans *= s[a[i] - a[i - 1] - 2];
    ans %= MOD;
  }
  ans *= s[n - a[m - 1] - 1];
  ans %= MOD;
  cout << ans << endl;
  return 0;
}
