#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int n, m, a[100001] = {0};
  ll p[100001] = {0};
  cin >> n >> m;
  for (int i(0); i < m; i++) {
    int ai;
    cin >> ai;
    a[ai] = 1;
  }
  if (a[1] == 1 && a[2] == 1) {
    cout << 0;
    return 0;
  } else if (a[1] == 1) {
    p[1] = 0;
    p[2] = 1;
  } else if (a[2] == 1) {
    p[1] = 1;
    p[2] = 0;
  } else {
    p[1] = 1;
    p[2] = 2;
  }
  for (int i(3); i <= n; i++) {
    if (a[i] == 1) continue;
    if (a[i - 1] == 1 && a[i - 2] == 1) {
      cout << 0;
      return 0;
    } else if (a[i - 1] == 1) {
      p[i] = p[i - 2];
    } else if (a[i - 2] == 1) {
      p[i] = p[i - 1];
    } else {
      p[i] = p[i - 1] + p[i - 2];
    }
  }
  cout << p[n] % 1000000007;
}
