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