#include <bits/stdc++.h>
using namespace std;
const int N = 1000000;
const long long mod = 1000000007;
using Graph = vector<vector<int>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
int main() {
  long long n, m;
  cin >> n >> m;
  long long dp[n + 1];
  memset(dp, -1, sizeof(dp));
  vector<long long> a(m);
  for (long long int i = 0; i < m; i++) {
    cin >> a[i];
    dp[a[i]] = 0;
  }
  dp[0] = 0;
  if (a[0] != 1) {
    dp[1] = 1;
  }
  if (a[0] == 1 && a[1] == 2) {
    dp[2] = 0;
  } else if (a[0] == 1 && a[1] != 2) {
    dp[2] = 1;
  } else if (a[0] == 2) {
    dp[2] = 0;
  } else {
    dp[2] = 2;
  }
  for (long long int i = 3; i < n + 1; i++) {
    if (dp[i] == -1) {
      dp[i] = dp[i - 1] + dp[i - 2];
      dp[i] %= mod;
    }
  }
  cout << dp[n] << endl;
}
