#include <bits/stdc++.h>
using namespace std;
const long long Q = 1000000007;
vector<long long> v(100001);
int main(int argc, const char* argv[]) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  v[0] = 0;
  v[1] = 1;
  v[2] = 1;
  for (long long i = 3; i < n; i++) v[i] = v[i - 1] + v[i - 2];
  vector<long long> a(m + 1), b(m + 1);
  for (long long i = 0; i < m; i++) cin >> a[i];
  a[m] = n + 1;
  b[0] = a[0];
  for (long long i = 1; i <= m; i++) b[i] = a[i] - a[i - 1] - 1;
  long long ans = 1;
  for (long long i = 0; i <= m; i++) {
    ans *= v[b[i]];
    ans %= Q;
  }
  cout << ans << endl;
  return 0;
}
