#include <bits/stdc++.h>
int main(void) {
  int n, m;
  int err = 0;
  int i;
  int start;
  int end;
  scanf("%d %d", &n, &m);
  int a[m + 1];
  for (i = 0; i < m; i++) {
    scanf("%d", &a[i]);
  }
  a[m] = n;
  if (err == 1) {
    printf("0\n");
    return 0;
  }
  int o[n + 1];
  o[0] = 1;
  o[1] = 1;
  for (i = 2; i < n + 1; i++) {
    o[i] = o[i - 1] + o[i - 2];
  }
  long int sum = 1;
  start = 0;
  end = a[0] - 1;
  for (i = 0; i < m; i++) {
    sum *= o[end - start];
    start = a[i] + 1;
    end = a[i + 1] - 1;
  }
  end = n;
  sum *= o[end - start];
  printf("%ld\n", sum % 1000000007);
}
