#include <bits/stdc++.h>
using namespace std;
unsigned int memo[100001];
int length = 0;
int main(void) {
  int n, nb, buf, before;
  n = nb = buf = before = 0;
  scanf("%d %d", &n, &nb);
  length = nb;
  for (int i = 0; i < nb; ++i) {
    scanf("%d", &buf);
    if (before + 1 == buf && i > 0) {
      cout << 0 << endl;
      return 0;
    }
    before = buf;
    memo[buf] = -1;
  }
  if (memo[1] == 4294967295) {
    memo[2] = 1;
  } else {
    memo[1] = 1;
    memo[2] = 2;
  }
  for (int i = 3; i <= n; ++i) {
    if (memo[i] == 4294967295) {
      memo[i + 1] = memo[i + 2] = memo[i - 1];
      i += 2;
    } else {
      if (memo[i - 2] == 4294967295) {
        memo[i] = memo[i - 1];
      } else if (memo[i - 1] == 4294967295) {
        memo[i] = memo[i - 2];
      } else {
        memo[i] = (memo[i - 2] + memo[i - 1]) % 1000000007;
      }
    }
  }
  cout << memo[n] << endl;
  return 0;
}
