#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int n, m, k, flag;
int a[100005];
long long sum[100005];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d", &a[i]);
    if (i > 1 && a[i] == a[i - 1] + 1) flag = 1;
  }
  a[m + 1] = n + 1;
  if (flag == 1) {
    printf("0");
    return 0;
  }
  k = 1;
  if (a[k] == 1)
    sum[2] = 1;
  else {
    for (int i = 1; i < a[k]; i++) {
      for (int j = 1; j <= 2 && i - j >= 0; j++) sum[i] += sum[i - j];
      sum[i] %= mod;
    }
  }
  while (k < m) {
    k++;
    for (int i = a[k - 1] + 1; i < a[k]; i++) {
      for (int j = 1; j <= 2 && i - j >= 0; j++) sum[i] += sum[i - j];
      sum[i] %= mod;
    }
  }
  for (int i = a[m] + 1; i <= n; i++) {
    for (int j = 1; j <= 2 && i - j >= 0; j++) sum[i] += sum[i - j];
    sum[i] %= mod;
  }
  printf("%lld", sum[n]);
  return 0;
}
