#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
void cmax(T& a, U b) {
  if (a < b) a = b;
}
template <class T, class U>
void cmin(T& a, U b) {
  if (a > b) a = b;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  vector<long long> a(m);
  for (long long i = 0; i < m; i++) {
    cin >> a[i];
  }
  vector<long long> fib(n + 10);
  fib[1] = 1;
  fib[2] = 1;
  for (long long i = 0; i < n; i++) {
    fib[i + 3] = fib[i + 2] + fib[i + 1];
  }
  const long long MOD = 1e9 + 7;
  a.push_back(n + 1);
  long long pre = -1;
  long long ans = 1;
  for (long long i = 0; i < m + 1; i++) {
    ans = (ans * fib[a[i] - pre - 1]) % MOD;
    pre = a[i];
    cerr << ans << endl;
  }
  cout << ans << endl;
}
