#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long N, M;
  cin >> N >> M;
  vector<long> broken(M + 2, 0);
  broken[0] = -1;
  for (int i = 1; i <= M; i++) {
    cin >> broken[i];
  }
  broken[M + 1] = N + 1;
  vector<long> pattern(100005, 0);
  pattern[0] = 1;
  pattern[1] = 1;
  for (int i = 2; i < 100005; i++) {
    pattern[i] = pattern[i - 2] + pattern[i - 1];
  }
  for (int i = 0; i < 100005; i++) {
    if (pattern[i] > 1000000007) pattern[i] %= 1000000007;
  }
  long ans = 1;
  for (int i = 0; i <= M; i++) {
    if (broken[i + 1] - broken[i] - 2 < 0)
      ans = 0;
    else {
      ans *= pattern[broken[i + 1] - broken[i] - 2];
      ans %= 1000000007;
    }
  }
  cout << ans << endl;
  return 0;
}
