#include <bits/stdc++.h>
using namespace std;
long long* a;
const long long mod = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  a = new long long[n + 1];
  a[0] = 1;
  for (int i = 1; i < n + 1; i++) {
    a[i] = -1;
  }
  for (int i = 0; i < m; i++) {
    long long t;
    cin >> t;
    a[t] = false;
  }
  for (int i = 1; i < n + 1; i++) {
    if (a[i + 1])
      continue;
    else
      a[i + 1] = (a[i] + a[i - 1]) % mod;
  }
  cout << a[n] << endl;
}
