#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m), dp(n + 1);
  for (int i = 0; i < m; i++) {
    cin >> a.at(i);
    if (i)
      if (a.at(i - 1) + 1 == a.at(i)) dp.at(0) = 1;
  }
  if (dp.at(0))
    cout << 0 << endl;
  else if (m) {
    if (a.at(0) == 1)
      dp.at(2) = 1;
    else if (a.at(0) == 2)
      dp.at(1) = 1;
    else {
      dp.at(1) = 1;
      dp.at(2) = 2;
    }
    for (int i = 3; i <= n; i++)
      if (find(a.begin(), a.end(), i) == a.end())
        dp.at(i) = (dp.at(i - 1) + dp.at(i - 2)) % 1000000007;
    cout << dp.at(n) << endl;
  } else {
    dp.at(1) = 1;
    dp.at(2) = 2;
    for (int i = 3; i <= n; i++)
      dp.at(i) = (dp.at(i - 1) + dp.at(i - 2)) % 1000000007;
    cout << dp.at(n) << endl;
  }
}
