#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
int main()
{
  int n,m;
  scnaf("%d %d",&n,&m);
  ll 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;
  ll 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);
}