#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> v(m);
  for (int i = 0; i < m; i++) {
    cin >> v[i];
  }
  long long num[100005] = {0};
  for (int i = 0; i <= n; i++) {
    if (i == 0) {
      num[i] = 1;
      continue;
    }
    if (i == 1) {
      num[i] = 1;
      continue;
    }
    num[i] = num[i - 1] + num[i - 2];
  }
  for (int i = 0; i < m; i++) {
    if (i < m - 1 && v[i] + 1 == v[i + 1]) {
      cout << 0 << endl;
      return 0;
    }
  }
  int now = 0;
  long long ans = 1;
  for (int i = 0; i < m; i++) {
    ans *= num[v[i] - now - 1];
    ans %= 1000000007;
    now += v[i] - now + 1;
  }
  ans *= num[n - now];
  ans %= 1000000007;
  cout << ans << endl;
  return 0;
}
