#include <bits/stdc++.h>
using namespace std;
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  int a[m];
  for (int i = 0; i < m; i++) cin >> a[i];
  unsigned long long dp[n + 1];
  long long dpp[n + 1];
  memset(dpp, -1, sizeof(dpp));
  memset(dp, 0, sizeof(dp));
  for (int i = 0; i < m; i++) {
    dpp[a[i]] = -2;
  }
  dp[0] = 1;
  if (dpp[1] != -2) dp[1] = 1;
  for (int i = 0; i < n - 1; i++) {
    if (dpp[i + 2] == -1 && dpp[i] != -2 && dpp[i + 1] != -2) {
      dp[i + 2] = dp[i + 1] + dp[i];
      dpp[i + 2] = 0;
    } else if (dpp[i + 2] == -1 && dpp[i] == -2 && dpp[i + 1] != -2) {
      dp[i + 2] = dp[i + 1];
      dpp[i + 2] = 0;
    } else if (dpp[i + 2] == -1 && dpp[i] != -2 && dpp[i + 1] == -2) {
      dp[i + 2] = dp[i];
      dpp[i + 2] = 0;
    } else if (dpp[i + 2] == -1 && dpp[i + 1] == -2 && dpp[i] == -2) {
      dp[i + 2] = 0;
      dpp[i + 2] = -2;
    }
  }
  if (dp[n] <= 0)
    cout << 0 << endl;
  else
    cout << dp[n] % 1000000007 << endl;
}
