#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int c[1000000];
int main() {
  int n, m, j = 1;
  long long a, b, temp;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) scanf("%d", &c[i]);
  sort(c + 1, c + 1 + m);
  if (c[1] == 1 || c[1] == 2) {
    a = 0;
    b = 1;
    j++;
    temp = 0;
  } else {
    a = 1;
    b = 2;
    temp = 0;
  }
  for (int i = 3; i <= n; i++) {
    if (i == c[j] && j <= m) {
      a = b;
      b = 0;
      j++;
      continue;
    }
    temp = a + b;
    a = b;
    b = temp % mod;
  }
  if (c[1] == 1 && c[2] == 0) {
    printf("0\n");
  } else if (n == 1) {
    printf("1\n");
  } else if (n == 2 && m == 1) {
    printf("1\n");
  } else if (n == 2 && m == 0) {
    printf("1\n");
  } else {
    printf("%lld\n", b);
  }
  return 0;
}
