#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[m];
  map<int, int> ma;
  long long b[n + 1];
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    ma[a[i]] = 1;
  }
  b[0] = 0;
  if (ma[1] != 1)
    b[1] = 1;
  else
    b[1] = 0;
  for (int i = 2; i <= n; i++) {
    if (ma[i] == 1)
      b[i] = 0;
    else
      b[i] = (b[i - 1] + b[i - 2]) % 1000000007;
  }
  cout << b[n] << "\n";
}
