#include <bits/stdc++.h>
int main() {
  long long N, M, i, j = 0, fib = 0, cnt = 0, min, ret = 1, ret2, diff = 0;
  long long a[100000], arr[100000];
  scanf("%lld %lld\n", &N, &M);
  for (i = 0; i < M; i++) {
    scanf("%lld\n", &a[i]);
  }
  a[M] = 0;
  for (i = 0; i <= N; i++) {
    if (i == 0 || i == 1) {
      arr[i] = 1;
    } else {
      arr[i] = arr[i - 1] + arr[i - 2];
    }
    if (a[i] == a[i + 1] - 1) {
      printf("0\n");
      return 0;
    }
  }
  for (i = 0; i < M; i++) {
    if (i == 0) {
      diff = a[i] - 1;
    } else {
      diff = a[i] - a[i - 1] - 1;
    }
    ret *= arr[diff - 1];
  }
  ret *= arr[N - a[M - 1] - 1];
  ret2 = ret % 1000000007;
  printf("%lld\n", ret2);
  return 0;
}
