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