#include <bits/stdc++.h>
#define ll long long int
#define MOD 1000000007
#define INF 1e18
#define PI 3.14159265358979

using namespace std;

int main(void){
  int n, m;
  cin >> n >> m;
  vector<ll> dp(n + 1, 0);

  int a;
  for (int i = 0; i < m; i++){
    cin >> a;
    dp[a] = -1;
  }


  dp[0] = 1;
  if (dp[1] != -1)
    dp[1] = 1;

  for (int i = 2; i <= n; i++){
    if (dp[i] == -1)
      continue;
    if (dp[i - 1] == -1 && dp[i - 2] == -1)
      dp[i] = -1;
    else if (dp[i - 1] == -1)
      dp[i] = dp[i - 2];
    else if (dp[i - 2] == -1)
      dp[i] = dp[i - 1];
    else
      dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
  }



  cout << max(0, dp[n]) << endl;

  return 0;
}
