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