#include <bits/stdc++.h>
using namespace std;
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 x, long long y) { return x / gcd(x, y) * y; }
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> b(n + 10);
  vector<long long> a(n + 10, 0);
  for (int i = 0; i < (m); i++) {
    int x;
    cin >> x;
    a[x] = 1;
  }
  b[0] = 1;
  b[1] = 1;
  if (a[1] != 0) {
    b[1] = 0;
  }
  for (int i = 2; i <= n; i++) {
    b[i] = b[i - 1] + b[i - 2];
    if (a[i] != 0) {
      b[i] = 0;
    }
    if (b[i] != 0 && b[i] != (b[i - 1] + b[i - 2])) {
      b[i] = b[i - 1] % 1000000007 + b[i - 2] % 1000000007;
    }
  }
  cout << b[n] % 1000000007 << endl;
  return 0;
}
