#include <bits/stdc++.h>
int N;
int M;
long long ans = 1;
int old_pos;
int new_pos;
long long hoge(int x) {
  if (x == 0) {
    return 0;
  } else if (x == 1) {
    return 1;
  } else if (x == 2) {
    return 2;
  } else {
    return hoge(x - 1) + hoge(x - 2);
  }
}
int main() {
  scanf("%d %d", &N, &M);
  for (int i = 0; i < M; i++) {
    scanf("%d", &new_pos);
    if (new_pos == 1) {
      continue;
    }
    printf("\t%d\n", new_pos - old_pos);
    ans = (hoge(new_pos - old_pos - 1) * ans) % 1000000007;
    printf("ans : %lld", ans);
    old_pos = new_pos;
  }
  ans = (hoge(N - new_pos - 1) * ans) % 1000000007;
  printf("%lld\n", ans);
}
