#include <bits/stdc++.h>
using namespace std;
bool breakCheck(int j, vector<int> &a) {
  for (int i = 0; i < a.size(); i++) {
    if (j + 1 == a.at(i)) {
      return true;
    }
  }
  return false;
}
bool impossibleCheck(vector<int> &a) {
  if (a.size() <= 1) {
    return false;
  } else {
    for (int i = 0; i < a.size() - 1; i++) {
      int one = max(a.at(i), a.at(i + 1));
      int two = min(a.at(i), a.at(i + 1));
      if (one - two == 1) {
        return true;
      }
    }
  }
  return false;
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < M; i++) {
    cin >> a.at(i);
  }
  vector<int> dp(N, 0);
  dp.at(dp.size() - 1) = 1;
  long long mod = 1000000007;
  if (impossibleCheck(a)) {
    cout << 0 << endl;
  } else {
    for (int i = dp.size() - 2; i >= 0; i--) {
      if (breakCheck(i, a)) {
        dp.at(i) = 0;
        continue;
      } else {
        if (i == dp.size() - 2) {
          dp.at(i) = 1;
        } else {
          dp.at(i) = (dp.at(i + 1) + dp.at(i + 2)) % mod;
        }
      }
    }
    int ans = dp[0] + dp[1];
    cout << ans << endl;
  }
}
