#include <bits/stdc++.h>
int main(void) {
  int N, M;
  scanf("%d%d", &N, &M);
  int a[M];
  int first = 0, second = 0;
  for (int i = 0; i < M; i++) {
    scanf("%d", &a[i]);
    if (a[i] == 1) first = 1;
    if (a[i] == 2) second = 1;
  }
  long long sum[100001];
  for (int i = 0; i < N + 1; i++) {
    sum[i] = 0;
  }
  if (first) {
    if (second)
      sum[1] = sum[2] = 0;
    else
      sum[1] = 0, sum[2] = 1;
  } else {
    if (second)
      sum[1] = 1, sum[2] = 0;
    else
      sum[1] = 1, sum[2] = 2;
  }
  int cnt = 0;
  for (int i = 0; i <= N; i++) {
    if (i == a[cnt])
      cnt++;
    else {
      if (i - 2 >= 0) sum[i] += sum[i - 2];
      if (i - 1 >= 0) sum[i] += sum[i - 1];
      sum[i] %= 1000000007;
    }
  }
  printf("%lld\n", sum[N]);
  return 0;
}
