#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
using namespace std;

int main() {
  int n, m, s = 0;
  cin >> n >> m;
  vector<bool> v(n, 1);
  vector<int> a(n, 0);
  rep(i, m){
    int b;
    cin >> b;
    v[b-1] = 0;
  }
  rep(i, n){
    if(i == 0 && v[0]) a[0] = 1;
    if(i == 1 && v[1]) a[1] = 1;
    if(i > 0 && v[i-1]) a[i] += a[i-1];
    if(i > 1 && v[i-2]) a[i] += a[i-2];
    a[i] %= 1000000007
  }
  cout << a[n-1] << endl;
  return 0;
}