#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
inline int countChar(string s, char c) {
  int cnt, i;
  cnt = 0;
  for (int(i) = (0); (i) < (s.size()); (i)++) {
    if (s[i] == c) cnt++;
  }
  return cnt;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
int main(void) {
  int n, m;
  cin >> n >> m;
  vector<int> broken(n + 1);
  for (int(i) = (0); (i) < (m); (i)++) {
    int idx;
    cin >> idx;
    broken[idx] = 1;
  }
  vector<long long> dp(n + 2);
  dp[n] = 1;
  for (int i = n - 1; i >= 0; i--) {
    if (broken[i]) {
      dp[i] = 0;
    } else {
      dp[i] = dp[i + 1] + dp[i + 2];
    }
  }
  cout << (dp[0] % 1000000007) << endl;
  return 0;
}
