#include <bits/stdc++.h>
using namespace std;
int n, m;
int modulo = 1000000007;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  vector<int> v(m);
  vector<int> v1(n + 1, -1);
  for (int i = 0; i < m; i++) {
    cin >> v[i];
    v1[v[i]] = 0;
  }
  sort(v.begin(), v.end());
  for (int i = 1; i < m; i++) {
    if (v[i] - 1 == v[i - 1]) return cout << 0, 0;
  }
  int k1 = 0, k2 = 1;
  if (v1[1] == 0) {
    k1 = 2;
    k2 = 3;
  } else if (v1[0] == 0) {
    k1 = 1;
    k2 = 2;
  }
  v1[k1] = 1;
  v1[k2] = 1;
  for (int i = k2 + 1; i <= n; i++) {
    if (v1[i] == 0) {
      v1[i + 1] = v1[i - 1];
      if (v1[i + 2] != 0) v1[i + 2] = v1[i - 1];
    } else if (v1[i] == -1) {
      if (v1[i - 1] == 0 || v1[i - 2] == 0)
        continue;
      else
        v1[i] = (v1[i - 1] + v1[i - 2]) % modulo;
    }
  }
  cout << v1[n];
  return 0;
}
