#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> brokens(M);
  for (int i = 0; i < (M); i++) cin >> brokens[i];
  if (M > 0) sort(brokens.begin(), brokens.end());
  vector<long long> ways(N + 1);
  for (int i = 0; i < (N + 1); i++) ways[i] = 0;
  int pre = -1;
  for (int i = 0; i < (brokens.size()); i++) {
    if (pre + 1 == brokens[i]) {
      cout << 0 << endl;
      return 0;
    } else {
      pre = brokens[i];
    }
  }
  int nextBrokenPos = M - 1;
  ways[N] = 1;
  if (N - 1 != brokens[nextBrokenPos])
    ways[N - 1] = 1;
  else if (nextBrokenPos > 0)
    nextBrokenPos--;
  for (int i = N - 2; i >= 0; i--) {
    if (i != brokens[nextBrokenPos])
      ways[i] = ways[i + 1] + ways[i + 2];
    else if (nextBrokenPos > 0)
      nextBrokenPos--;
  }
  cout << ways[0] % 1000000007 << endl;
  return 0;
}
