#include <bits/stdc++.h>
using namespace std;
const long long int mo = 1e9 + 7;
long long int a[100005], re[100005];
int main() {
  long long int i, j, k, n, m, t;
  cin >> n >> m;
  long long int f = 0, pre = -1;
  for (i = 0; i < m; i++) {
    cin >> k;
    if (k - pre == 1) {
      f = 1;
    }
    pre = k;
    a[k] = 1;
  }
  if (f)
    cout << "0\n";
  else {
    re[0] = 1;
    if (!a[1]) re[1] = 1;
    if (!a[2]) re[2] = 2;
    for (i = 3; i <= n; i++) {
      if (a[i]) continue;
      a[i] = 0;
      if (!a[i - 1]) a[i] += a[i - 1], a[i] %= mo;
      if (!a[i - 2]) a[i] += a[i - 2], a[i] %= mo;
    }
    cout << a[n] << "\n";
  }
}
