#include <bits/stdc++.h>
int wa(int n) {
  int w[100001];
  w[0] = 0;
  w[1] = 1;
  w[2] = 2;
  if (n == 0) return w[0];
  if (n == 1) return w[1];
  if (n == 2) return w[2];
  for (int j = 3; j <= n; j++) {
    w[j] = w[j - 1] + w[j - 2];
  }
  return w[n];
}
int main() {
  long long n, m, a[100001], b[10], seki = 1;
  a[0] = 0;
  scanf("%lld%lld", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%lld", &a[i]);
    b[i] = a[i] - a[i - 1] - 1;
  }
  b[m + 1] = n - a[m] - 1;
  for (int i = 1; i <= m + 1; i++) {
    seki *= wa(b[i]);
  }
  printf("%lld", seki % 1000000007);
  return 0;
}
