#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  queue<int> q;
  for (int i = 0; i < (m); i++) {
    int a;
    cin >> a;
    q.push(a);
  }
  long long dp[n + 1];
  dp[0] = 1;
  if (q.front() == 1) {
    dp[1] = 0;
    q.pop();
  } else {
    dp[1] = 1;
  }
  if (n >= 2) {
    for (int i = 2; i < n + 1; i++) {
      if (i == q.front()) {
        dp[i] = 0;
        q.pop();
      } else {
        dp[i] = dp[i - 1] + dp[i - 2];
      }
    }
  }
  cout << dp[n] % (1000000007) << endl;
}
