#include <bits/stdc++.h>
using namespace std;
int broke[100005];
const int maxa = 2;
int n, m;
int main() {
  memset(broke, 0, sizeof(broke));
  cin >> n >> m;
  int k = 0;
  for (int i = 0; i < m; ++i) {
    cin >> k;
    broke[k] = 1;
  }
  for (int i = 1; i < n; ++i) {
    if (broke[i] && broke[i - 1]) {
      cout << "0";
      return 0;
    }
  }
  long long f1 = 1, f2 = 1;
  long long f = 0;
  for (int i = 2; i <= n; ++i) {
    if (!broke[i] && !broke[i - 1]) {
      f = (f1 + f2) % 1000000007;
      f1 = f2;
      f2 = f;
    } else
      f1 = 0;
  }
  printf("%lld", f);
  return 0;
}
