#include <iostream>
#include <cmath>
#include <string>
#include <queue>

typedef long long lint;

using namespace std;

int main(){
  lint n,i,m,k,ans;
  const lint mod = 1e9 + 7;
  queue<lint> a;
  cin >> n >> m;
  for(i = 0; i < m; i++){
    cin >> k;
    a.push(k); 
  }
  k = a.front();
  a.pop();
  //dpテーブル
  lint dp[n + 1] = {};
  //初期化
  dp[0] = 1;
  for(i = 1; i <= n; i++){
    if(i > 1){
      if(i - 2 != k){
        dp[i] += dp[i - 2];
      }else{
        k = a.front();
        a.pop();
      }
    }
    if(i - 1 != k){
      dp[i] += dp[i - 1];
    }
    dp[i] %= mod;
  }
  ans = dp[n];
  cout << ans;
}

