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