#include <bits/stdc++.h>
using namespace std;

int main() {
  int n,m;
  cin >> n >> m;
  vector<int> v(m);
  for(int i=0;i<m;i++){
    cin >> v[i];
  }
  
  //defining fibonacci sequence (though f(1)=1, f(2)=2) ok!
  
  vector<int> fib(n+1);
  for(int j=1;j<=n;j++){
    if(j==1){
      fib[j]=1;
    }
    else if(j==2){
      fib[j]=2;
    }
    else{
      fib[j]=fib[j-1]+fib[j-2];
    }
    
  }
  
  //defining the number of stairs
  
    vector<int> s(m+1);
    s[0]=v[0]-1;
    for(int k=1;k<m;k++){
      s[k]=v[k]-v[k-1]-2;
    }
    s[m]=v[m]-1;
    
    int ans=1;
    for(int l=0;l<m+1;l++){
      ans*=fib[s[l]]
      ans=ans%1000000007;
    }
  
  cout << ans%1000000007 << endl;    
  
}
