#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
long long GCD(long long x, long long y) {
  if (y == 0)
    return x;
  else
    return GCD(y, x % y);
}
long long LCM(long long a, long long b) { return a / GCD(a, b) * b; }
const int MOD = 1000000007;
bool b[10000];
int main() {
  long long n, m;
  cin >> n >> m;
  long long a[n + 1];
  a[0] = 1;
  for (int i = 0; i < m; i++) {
    long long x;
    cin >> x;
    b[x] = true;
    ;
  }
  if (!b[1]) {
    a[1] = 1;
  } else {
    a[1] = 0;
  }
  for (int i = 2; i < n + 1; i++) {
    a[i] = 0;
    if (!b[i]) {
      if (!b[i - 1]) {
        a[i] += a[i - 1] % MOD;
      }
      if (!b[i - 2]) {
        a[i] += a[i - 2] % MOD;
      }
    }
  }
  cout << a[n] % MOD;
}
