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

int main(){
  int m,n;
  long long dp[n+1];
  dp[0] = 1;
  dp[1] = 1;
  cin >> n >> m;
  int a[100007]={},b[m]={};
  for(int i=0;i<m;i++){
    cin >> b[i];
    a[b[i]] = 1;
  }
  for(int i=0;i<n-1;i++){
    if(a[1]==1){
      dp[1] = 0;
    }
    dp[i+2] = dp[i+1]+ dp[i];
    dp[i+2] %= 1000000007;
    if(a[i+2] == 1)
      dp[i+2] = 0;
  }
  cout << dp[n] << endl;
}