#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() {
  int n;
  cin >> n;
  dp.assign(n + 1, -1);
  std::vector<int> check = {-1};
  int m;
  cin >> m;
  for (int i = 0; i < m; ++i) {
    int a;
    cin >> a;
    check.push_back(a);
  }
  check.push_back(n + 1);
  ll ans = fib(check[1] - check[0] - 1);
  for (int i = 2; i < m + 2; ++i) {
    ans *= fib(check[i] - check[i - 1] - 1);
    if (ans >= 1000000007) ans = ans % (1000000007);
  }
  for (int i = 0; i < m + 1; ++i) {
    if (check[i] == check[i + 1]) ans = 0;
  }
  cout << ans << endl;
}
