#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int M;
  cin >> M;
  unordered_set<int> ob;
  vector<long long> dp(N + 2);
  for (int i = 0; i < M; i++) {
    int tmp;
    cin >> tmp;
    ob.insert(tmp);
  }
  dp[0] = 0;
  dp[1] = 1;
  for (int i = 2; i <= N + 1; i++) {
    if (ob.count(i - 1) > 0)
      dp[i] = 0;
    else {
      dp[i] = dp[i - 1] + dp[i - 2];
    }
  }
  cout << (dp.back() % 1000000007) << endl;
  return 0;
}
