#include <bits/stdc++.h>
using namespace std;
void print(bool a) {
  if (a == true)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
long long int gcdll(long long int a, long long int b) {
  while (1) {
    if (a < b) swap(a, b);
    if (b == 0) break;
    a %= b;
  }
  return a;
}
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
long long int f[100002] = {};
void fib() {
  for (int i = 2; i < 100002; i++) {
    f[i] = (f[i - 1] + f[i - 2]) % (int)(1e9 + 7);
  }
}
int main() {
  f[0] = 1;
  f[1] = 1;
  fib();
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  long long int ans = 1;
  for (int i = 0; i < m; i++) cin >> a[i];
  for (int i = 0; i < m; i++) {
    if (i != 0) {
      if (a[i] - a[i - 1] == 1) {
        cout << 0 << endl;
        return 0;
      }
    }
    if (i == 0)
      ans *= f[a[0] - 1];
    else
      ans *= f[a[i] - a[i - 1] - 2];
    ans %= (int)(1e9 + 7);
  }
  ans *= f[n - a[m - 1] - 1];
  ans %= (int)(1e9 + 7);
  cout << ans << endl;
}
