#include <bits/stdc++.h>
int function(int N) {
  int a = 1, b = 2;
  int tmp;
  for (int i = 0; i < N - 1; i++) {
    tmp = a;
    a = b;
    b += tmp;
  }
  return a;
}
int main() {
  int N, M;
  scanf("%d", &N, &M);
  long long int ans = 0;
  int start = 1, end;
  for (int i = 0; i < M; i++) {
    scanf("%d", &end);
    if (start == end) {
      printf("0");
      return 0;
    }
    ans = (ans + function(end - start)) % 1000000007;
    start = end + 1;
  }
  printf("%lld", ans);
  return 0;
}
