#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  int bk[M + 2];
  bk[0] = -1;
  for (int i = 0; i < M; i++) {
    cin >> bk[i + 1];
  }
  bk[M + 1] = N + 1;
  int fb[N + 1];
  fb[0] = 0;
  fb[1] = 1;
  for (int i = 2; i < N + 1; i++) {
    fb[i] = fb[i - 1] + fb[i - 2];
    if (fb[i] >= 1000000007) {
      fb[i] -= 1000000007;
    }
  }
  long long total = 1;
  for (int i = 0; i < M + 1; i++) {
    total *= fb[bk[i + 1] - bk[i] - 1];
    total %= 1000000007;
    if (!total) break;
  }
  cout << total << endl;
}
