#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<bool> b(n + 1, false);
  vector<long long> a(n + 1, 0);
  a[0] = 1;
  for (int i = (0); i < (m + 1); i++) {
    int c;
    cin >> c;
    b[c] = true;
  }
  for (int i = (1); i < (n + 1); i++) {
    if (i == 1)
      a[1] = 1;
    else
      a[i] = (a[i - 1] + a[i - 2]) % 1000000007;
    if (b[i]) a[i] = 0;
  }
  cout << a[n];
}
