#include <bits/stdc++.h>
using namespace std;
long long conb(long long a) {
  if (a <= 0) {
    return 0;
  } else if (a == 1) {
    return 1;
  } else {
    return conb(a - 1) + conb(a - 2);
  }
}
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];
  }
  int 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;
}
