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