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