#include <bits/stdc++.h>
using namespace std;
map<int, long long> rec;
long long conb(int a) {
  if (rec.find(a) != rec.end()) {
    return rec[a];
  } else {
    if (a <= 0) {
      return 0;
    } else if (a == 1) {
      return 1;
    } else {
      long long tmp = conb(a - 1) + conb(a - 2);
      rec.insert(make_pair(a, tmp));
      return tmp;
    }
  }
}
int main() {
  long long mod = 1000000007;
  long long N, M;
  cin >> N >> M;
  vector<long long> a(M + 2);
  a[0] = -1;
  a[M + 1] = N + 1;
  for (int i = (1); i < (M + 1); i++) {
    cin >> a[i];
  }
  long long ans = 1;
  for (int i = (1); i < (M + 2); i++) {
    ans = (ans * conb(a[i] - a[i - 1] - 1)) % mod;
  }
  cout << ans << endl;
  return 0;
}
