#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  vector<int> a;
  cin >> n >> m;
  int temp;
  for (int i = 0; i < m; i++) {
    cin >> temp;
    a.push_back(temp);
  }
  long long* dp;
  dp = new long long[n + 1];
  int k = 0;
  for (int i = 0; i < n + 1; i++) {
    if (i == a[k]) {
      dp[i] = 0;
      k++;
    } else if (i > 1) {
      dp[i] = dp[i - 1] + dp[i - 2];
    } else {
      dp[i] = 1;
    }
  }
  cout << dp[n] % 1000000007 << endl;
}
