#include <bits/stdc++.h>
using namespace std;
using MIte = multimap<vector<long>, int>::iterator;
const long long mod_const = 1000000007;
long long Pattern(int i, const vector<int>& vA) {
  if (i == 0) {
    return 1;
  } else if (i == 1) {
    return 1;
  } else {
    long long a = 0;
    long long b = 0;
    if (vA[i - 2] == 0) a = 1;
    if (vA[i - 1] == 0) b = 1;
    return ((a * Pattern(i - 2, vA) + b * Pattern(i - 1, vA)) % mod_const);
  }
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> vA(N + 1, 0);
  for (int i = 0; i != M; ++i) {
    int w = 0;
    cin >> w;
    vA[w] = 1;
    if (w >= 1) {
      if (vA[w - 1] == 1) {
        cout << "0" << endl;
        return 0;
      }
    }
  }
  vector<long long> vPattern(N + 1, 0);
  vPattern[0] = 1;
  vPattern[1] = 1;
  int i = 2;
  while (1) {
    long long a = 0;
    long long b = 0;
    if (vA[i - 2] == 0) a = 1;
    if (vA[i - 1] == 0) b = 1;
    if (vA[i] == 0) {
      vPattern[i] = (a * vPattern[i - 2] + b * vPattern[i - 1]) % mod_const;
    } else {
      vPattern[i] = 0;
    }
    i++;
    if (i == N + 1) {
      break;
    }
  }
  cout << vPattern[N] << endl;
  return 0;
}
