#include <bits/stdc++.h>
using namespace std;
long long able[1000000];
int main() {
  int n, m;
  cin >> n >> m;
  int t;
  for (int i = 0; i < m; i++) {
    cin >> t;
    able[t] = 1;
  }
  long long t1 = 1, t2 = 0;
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    if (able[i] == 1) {
      ans = 0;
    } else {
      ans = t1 + t2;
    }
    t2 = t1;
    t1 = ans;
  }
  cout << ans % 1000000007 << endl;
  return 0;
}
