#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const double PI = acos(-1);
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> br(n + 1, true);
  vector<long long> path(n + 1, 0);
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    br.at(x) = false;
  }
  path[0] = 1;
  if (br[1]) path[1] = path[0];
  for (int i = 2; i <= n; i++) {
    if (!br[i]) continue;
    if (br[i - 1] && br[i - 2])
      path[i] = path[i - 1] + path[i - 2];
    else if (br[i - 1])
      path[i] = path[i - 1];
    else if (br[i - 2])
      path[i] = path[i - 2];
  }
  cout << path[n] % MOD << endl;
}
