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