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