#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  long long fib[n];
  fib[1] = 1;
  fib[2] = 2;
  for (int i = 3; i <= n; i++) fib[i] = (fib[i - 1] + fib[i - 2]) % mod;
  int val = 0;
  long long total = 0;
  for (int i = 0; i < m; i++) {
    int temp;
    scanf("%d", &temp);
    total = (total + fib[temp - 1 - val]) % mod;
    val = temp;
  }
  printf("%lld", total);
}
