#include <bits/stdc++.h>
using namespace std;
typedef vector<vector<int> > vii;
bool find(vector<int> &a, int key) {
  bool can = false;
  for (int i : a) {
    if (i == key) {
      can = true;
      break;
    }
  }
  return can;
}
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < (int)m; i++) cin >> a[i];
  vector<int> walk(n + 1);
  for (int i = 1; i < n + 1; i++) {
    if (find(a, i))
      walk[i] = 0;
    else {
      if (i == 1)
        walk[i] = 1;
      else if (i == 2)
        walk[i] = walk[1] + 1;
      else
        walk[i] = (walk[i - 1] + walk[i - 2]) % 1000000007;
    }
  }
  cout << walk[n] << '\n';
}
