#include <bits/stdc++.h>
using namespace std;
int cannot_step[(100000 + 1)] = {0};
long long num_path[(100000 + 1)] = {0};
long long mod(long long val, long long m) {
  long long res = val % m;
  if (res < 0) res += m;
  return res;
}
int main(void) {
  int n, m;
  int impossible = 0;
  stack<int> index_stack;
  for (int i = 0; i < (100000 + 1); ++i) {
    num_path[i] = -1;
  }
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; ++i) {
    int a;
    scanf("%d", &a);
    cannot_step[a] = 1;
    if (cannot_step[a] == cannot_step[a - 1] == 1) {
      impossible = 1;
    }
  }
  if (impossible) {
    printf("0\n");
    return 0;
  }
  num_path[0] = 1;
  num_path[1] = 1;
  index_stack.push(n);
  while (index_stack.empty() == 0) {
    int index = index_stack.top();
    if (index < 0) {
      index_stack.pop();
    }
    if (num_path[index] != -1) {
      index_stack.pop();
    }
    if (num_path[index - 1] == -1 && cannot_step[index - 1] == 0) {
      index_stack.push(index - 1);
    }
    if (num_path[index - 2] == -1 && cannot_step[index - 2] == 0) {
      index_stack.push(index - 2);
    }
    long long ans = 0;
    if ((num_path[index - 1] != -1 || cannot_step[index - 1]) &&
        (num_path[index - 2] != -1 || cannot_step[index - 2])) {
      if (cannot_step[index - 1] == 0) {
        ans += num_path[index - 1];
        ans = mod(ans, (1000000007));
      }
      if (cannot_step[index - 2] == 0) {
        ans += num_path[index - 2];
        ans = mod(ans, (1000000007));
      }
      num_path[index] = ans;
      index_stack.pop();
    }
  }
  printf("%lld\n", num_path[n]);
  return 0;
}
