#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll solve(ll a, ll b, vector<ll> &fib) {
  if (a > b) return 0;
  const ll div = 1000000007;
  ll n = b - a;
  return fib.at(n) % div;
}
int main() {
  ll n, m;
  cin >> n >> m;
  const ll div = 1000000007;
  ll ans = 1;
  vector<ll> fib(n + 1);
  fib.at(0) = 1;
  fib.at(1) = 1;
  for (int i = 2; i < n + 1; i++) {
    fib.at(i) = (fib.at(i - 1) + fib.at(i - 2)) % div;
  }
  if (m == 0) {
    ans = ans * solve(0, n, fib) % div;
  } else {
    vector<ll> a(m);
    for (int i = 0; i < m; i++) cin >> a.at(i);
    for (int i = 0; i < m - 1; i++) {
      ans *= solve(a.at(i) + 1, a.at(i + 1) - 1, fib) % div;
    }
    ans = ans * solve(0, a.at(0) - 1, fib) % div;
    ans = ans * solve(a.at(m - 1) + 1, n, fib) % div;
  }
  cout << ans << endl;
}
