#include <bits/stdc++.h>
#include <boost/multi_array.hpp>
#include <boost/range/algorithm.hpp>
#define rep(i,n) for (int i=0; i< (n); ++i)
using namespace std;
typedef long long ll;

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