#include <bits/stdc++.h>
using namespace std;
using ll = unsigned long long int;
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  for (int i = 0; i < vec.size(); i++) {
    os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
  }
  return os;
}
ll _max = 0;
ll dp[10000000] = {0};
ll climb(ll s, ll e) {
  ll n = e - s;
  if (_max != 0) {
    if (n <= _max)
      return dp[n];
    else {
      for (int i = _max + 1; i <= n; ++i) {
        dp[i] = dp[i - 1] + dp[i - 2];
      }
      _max = n;
      return dp[n];
    }
  }
  if (n <= 0) return 1;
  if (n == 1) {
    return 1;
  }
  dp[1] = 1;
  dp[2] = 2;
  for (int i = 3; i <= n; i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  _max = n;
  return dp[n];
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m, tmp1 = 0, tmp2 = -1, point = 0;
  ll result = 1;
  cin >> n >> m;
  for (int i = 0; i < (int)(m); i++) {
    cin >> tmp1;
    if (tmp1 - 1 == tmp2) {
      cout << 0 << endl;
      return 0;
    }
    tmp2 = tmp1;
    result *= climb(point, tmp1 - 1);
    point = tmp1 + 1;
  }
  result *= climb(point, n);
  cout << result % 1000000007 << endl;
}
