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