#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, M;
  cin >> N >> M;
  int a[M];
  for (int i = 0; i < M; i++) cin >> a[i];
  long long int x = 1, y = 0;
  int cnt = 0;
  for (int i = 0; i < N; i++) {
    long long int tmp = x;
    if (i + 1 == a[cnt]) {
      y = x;
      x = 0;
      cnt++;
    } else {
      x = x + y;
      y = tmp;
    }
  }
  cout << x % 1000000007 << endl;
  return 0;
}
