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