#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

ll dp[100010];

int main(){
  int n,m;
  cin >> n >> m;
  int a[m+2]={};
  a[0]=-1;
  a[m+1]=n+1;
  rep(i,m)cin >> a[i+1];
  ll ans=1;
  dp[0]=0;
  dp[1]=1;
  for(int i=2;i<=n+100+n;i++){
    dp[i]=dp[i-1]+dp[i-2];
  }
  rep(i,m+1){
    ans*=dp[a[i+1]-a[i]-1];
    ans%=mod;
  }
  cout << ans << endl;
return 0;}