#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <typename T = int>
T in() {
  T x;
  cin >> x;
  return (x);
}
std::vector<std::vector<long long>> comb(int n, int r) {
  std::vector<std::vector<long long>> v(n + 1,
                                        std::vector<long long>(n + 1, 0));
  for (int i = 0; i < v.size(); i++) {
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for (int j = 1; j < v.size(); j++) {
    for (int k = 1; k < j; k++) {
      v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
    }
  }
  return v;
}
ll fibonacci(ll x) {
  vector<ll> dp(max(2LL, x + 1), 0);
  dp[0] = 0;
  dp[1] = 1;
  for (int i = 2; i < x + 1; i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  return dp[x];
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N = in<ll>(), M = in<ll>();
  vector<ll> A(M);
  for (int i = 0; i < (M); ++i) A[i] = in<ll>();
  ll num = 1, oldM = 0, oldA = -1;
  for (int i = 0; i < M; i++) {
    if (abs(oldA - A[i]) < 2) {
      cout << 0 << endl;
      return 0;
    }
    ll K = A[i] - oldM;
    ll psum = fibonacci(K);
    num *= psum;
    num %= 1000000007;
    oldA = A[i];
    oldM = oldA + 1;
  }
  if (oldM < N) {
    if (abs(oldA - N) < 2) {
      cout << 0 << endl;
      return 0;
    }
    ll K = N + 1 - oldM;
    ll psum = fibonacci(K);
    num *= psum;
    num %= 1000000007;
  }
  cout << num << endl;
  return 0;
}
