#include <bits/stdc++.h>
using namespace std;
int a[300000];
int f[50000000];
bool bad[5000000];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) cin >> a[i];
  f[1] = 1;
  f[2] = 2;
  for (int i = 1; i <= m; i++) bad[a[i]] = true;
  for (int i = 3; i <= n; i++) {
    if (bad[i] == true)
      f[i] = 0;
    else {
      f[i] = f[i - 1] + f[i - 2];
      f[i] = f[i] % 1000000007;
    }
  }
  cout << f[n] % 1000000007;
}
