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