#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  for (ll i = (0), __last_i = (v.size()); i < __last_i; i++) {
    if (i) os << " ";
    os << v[i];
  }
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
  for (ll i = (0), __last_i = (v.size()); i < __last_i; i++) {
    if (i) os << endl;
    os << v[i];
  }
  return os;
}
vector<long long> dp;
long long fib(int n) {
  if (dp[n] != -1) return dp[n];
  if (n == 0) return 0;
  if (n == 1) return 1;
  return dp[n] = fib(n - 1) + fib(n - 2);
}
int main() {
  bool flag = true;
  int n, m;
  cin >> n >> m;
  dp.assign(n + 1, -1);
  std::vector<int> v;
  v.push_back(-1);
  for (int i = 0; i < m; ++i) {
    int a;
    cin >> a;
    v.push_back(a);
  }
  v.push_back(n + 1);
  std::vector<int> DEL;
  for (int i = 1; i < (int)v.size(); ++i) DEL.push_back(v[i] - v[i - 1]);
  ll ans = 1;
  for (int i = 0; i < (int)DEL.size(); ++i) {
    ans *= fib(DEL[i]);
    if (ans >= 1000000007) ans = ans % 1000000007;
  }
  if (flag == false) ans = 0;
  cout << ans << endl;
}
