#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;
}
int main() {
  int n, m;
  cin >> n >> m;
  long long ans;
  long long mod = 1000000007;
  vector<int> a(m);
  if (m > 1) {
    for (int i = 0; i < m; i++) {
      cin >> a[i];
    }
    vector<int> sa(m + 1);
    sa[0] = a[0] - 1;
    for (int i = 1; i < m; i++) {
      sa[i] = a[i] - a[i - 1] - 2;
    }
    sa[m] = n - a[m - 1] - 1;
    vector<long long> dp(n + 2);
    dp[0] = 0;
    dp[1] = 1;
    for (int i = 2; i <= n + 1; i++) {
      dp[i] = dp[i - 1] + dp[i - 2];
    }
    long long ans = 1;
    vector<int> v(m + 1);
    for (int i = 0; i <= m; i++) {
      v[i] = dp[sa[i] + 1] % mod;
      ans *= v[i];
      ans = ans % mod;
    }
  } else {
    vector<long long> dp(n + 2);
    dp[0] = 0;
    dp[1] = 1;
    for (int i = 2; i <= n + 1; i++) {
      dp[i] = dp[i - 1] + dp[i - 2];
    }
    ans = dp[n + 1];
  }
  cout << ans << endl;
}
