#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  int x;
  vector<long long> a(n + 1, 0);
  a[1] = 1;
  a[2] = 2;
  for (int i = 0; i < m; i++) {
    cin >> x;
    a[x] = -1;
  }
  if (a[1] == -1) {
    a[2] = 1;
  }
  for (int i = 3; i <= n; i++) {
    if (i != n && a[i] == -1) {
      if (i != n && a[i + 1] == -1) {
        cout << 0;
        return 0;
      }
      a[i + 1] = a[i - 1];
    } else if (a[i - 1] != -1) {
      a[i] = (a[i - 1] % 1000000007 + a[i - 2] % 1000000007) % 1000000007;
      if (a[i - 1] == -1 || a[i - 2] == -1) {
        a[i] += 1;
      }
    }
  }
  cout << a[n] % 1000000007;
  return 0;
}
