#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> broken(100002, 0);
  int before = -1;
  bool cut = false;
  for (int i = 0; i < m + 1; i++) {
    int tmp;
    cin >> tmp;
    broken[tmp + 1] = 1;
    if (before != -1) {
      if (tmp - before == 1) {
        cut = true;
        break;
      }
    }
    before = tmp;
  }
  if (!cut) {
    vector<int> dp(100002, 0);
    vector<int> dp2(100002);
    dp[1] = 1;
    for (int i = 0; i < n + 1; i++) {
      for (int j = 0; j <= n + 1; j++) {
        dp2[j] = dp[j];
      }
      for (int j = i + 1; j <= n + 1; j++) {
        if (broken[j + 1] != 1) {
          dp[j + 1] = (dp2[j] + dp2[j - 1]) % 1000000007;
        }
      }
    }
    cout << dp[n + 1] << endl;
  } else {
    cout << 0 << endl;
  }
  return 0;
}
