#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  long long dp[n + 1];
  memset(dp, 0, n + 1);
  for (int i = 0; i < m; i++) {
    int index;
    cin >> index;
    dp[index] = -1;
  }
  dp[0] = 1;
  if (dp[1] == (-1))
    dp[1] = 0;
  else
    dp[1] = dp[0];
  for (int i = 2; i < n + 1; i++) {
    if (dp[i] != -1)
      dp[i] = dp[i - 1] + dp[i - 2];
    else
      dp[i] = 0;
  }
  cout << dp[n] % 1000000007;
  return 0;
}
