#include<algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main()
{
  long n, m;
  cin >> n >> m;
  vector<long>a;
  vector<long>b;
  a.push_back(-1);
  for(long i = 0; i < m; i++){
    long x;
    cin >> x;
    a.push_back(x);
  }
  a.push_back(n+1);
  for(long i = 0; i < m + 1; i++){
    long d = a[i+1] - a[i] - 2;
    if(d < 0){
      cout << 0;
      return 0;
    }
    b.push_back(d);
  }
  long mn = *max_element(b.begin(),b.end()) + 1;
  vector<long>dp(mn);
  dp[0] = 1;
  dp[1] = 1;
  for(long i = 2; i < mn; i++){
    dp[i] = dp[i-2] + dp[i-1];
  }
  long ans = 1;
  
  for(auto x : b){
    ans *= dp[x];
    ans %= 1'000'000'007;
  }
  cout << ans % 1'000'000'007;
  return 0;
}