#include <iostream>
#include <vector>
using namespace std;
int main()
{
  int n, m;
  cin >> n >> m;
  vector<int>a(n + 1, 0);
  for(int i = 0; i < m; i++){
    int x;
    cin >> x;
    a[x] = 1;
  }
  vector<long>dp(n + 1, 0);
  dp[0] = 1;
  if(a[1] == 0){
    dp[1] = 1;
  }
  for(int i = 2; i < n + 1; i++){
    if(a[i-2] == 0){
      dp[i] += dp[i-2];
    }
    if(a[i-1] == 0){
      dp[i] += dp[i-1];
    }
  }
  cout << dp[n] % 1'000'000'007;
  return 0;
}