#include <bits/stdc++.h>
int cannot_step[(100000 + 1)] = {0};
int num_path[(100000 + 1)] = {0};
int add(int a, int b) { return (a + b) % (1000000007); }
int get_num_path(int index) {
  if (index < 0) {
    return 0;
  }
  if (num_path[index] != 0) {
    return num_path[index];
  }
  int ans = 0;
  if (cannot_step[index - 1] == 0) {
    ans += get_num_path(index - 1);
    ans %= (1000000007);
  }
  if (cannot_step[index - 2] == 0) {
    ans += get_num_path(index - 2);
    ans %= (1000000007);
  }
  num_path[index] = ans;
  return ans;
}
int main(void) {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; ++i) {
    int a;
    scanf("%d", &a);
    cannot_step[a] = 1;
  }
  num_path[0] = 1;
  num_path[1] = 1;
  int ans = get_num_path(n);
  printf("%d\n", ans);
  return 0;
}
