#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  auto a = vector<int>(m, 0);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  auto dp = vector<long long>(n + 1, 0);
  dp[0] = 1;
  dp[1] = 1;
  for (int j = 0; j < m; j++) {
    if (a[j] == 1) {
      dp[1] = 0;
      break;
    }
  }
  for (int i = 0; i < n - 1; i++) {
    bool flag = false;
    for (int j = 0; j < m; j++) {
      if (a[j] == i + 2) {
        flag = true;
        break;
      }
    }
    if (flag) {
      dp[i + 2] = 0;
    } else {
      dp[i + 2] += dp[i + 1] + dp[i];
      dp[i + 2] %= 1000000007;
    }
  }
  cout << dp[n];
}
