#include <bits/stdc++.h>
static const long long MAX = 1000000007;
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int a[m + 1];
  a[0] = -1;
  long long p[n + 1];
  p[0] = 1;
  p[1] = 1;
  p[2] = 2;
  if (n > 2) {
    for (int i = 3; i <= n; i++) {
      p[i] = (p[i - 1] + p[i - 2]) % MAX;
    }
  }
  long long cnt = 1;
  if (m > 0) {
    for (int i = 1; i <= m; i++) {
      scanf("%d", &a[i]);
      if ((a[i] - a[i - 1]) == 1) {
        printf("%d\n", 0);
        return 0;
      }
    }
    for (int i = 1; i <= m; i++) {
      cnt *= p[(a[i] - 1) - (a[i - 1] + 1)] % MAX;
    }
  }
  cnt *= p[n - (a[m] + 1)] % MAX;
  printf("%lld\n", cnt % MAX);
  return 0;
}
