#include <bits/stdc++.h>
using namespace std;
template <class T>
void show(vector<T>& v) {
  for (uint i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << "\n";
}
int main(int argc, char* argv[]) {
  uint N, M;
  cin >> N >> M;
  long long mod = 1e9 + 7;
  vector<bool> hole(N + 1, false);
  int a;
  for (uint i = 0; i < M; i++) {
    cin >> a;
    hole[a] = true;
  }
  vector<long long> dp(N + 1, 0);
  for (uint i = 0; i < N + 1; i++) {
    if (i == 0 || i == 1 || i == 2) {
      if (!hole[1] && !hole[2]) {
        dp[0] = 0;
        dp[1] = 1;
        dp[2] = 2;
      } else if (hole[1]) {
        dp[0] = 0;
        dp[1] = 0;
        dp[2] = 1;
      } else if (hole[2]) {
        dp[0] = 0;
        dp[1] = 1;
        dp[2] = 0;
      } else if (hole[1] && hole[2]) {
        cout << "0" << endl;
        exit(0);
      }
    } else {
      if (hole[i - 1] && hole[i - 2]) {
        cout << "0" << endl;
        exit(0);
      } else if (hole[i - 2]) {
        dp[i] = dp[i - 1];
      } else if (hole[i - 1]) {
        dp[i] = dp[i - 2];
      } else {
        dp[i] = dp[i - 1] + dp[i - 2];
      }
    }
  }
  cout << dp[N] % mod << endl;
  return 0;
}
