#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
int main() {
  lli N, M;
  cin >> N >> M;
  vector<lli> calc(N);
  calc[0] = 1;
  calc[1] = 1;
  calc[2] = 2;
  for (int i = 3; i < N; ++i) {
    calc[i] = calc[i - 1] + calc[i - 2];
  }
  vector<lli> a(M + 1);
  for (int i = 0; i < M; ++i) {
    cin >> a[i];
  }
  a[M] = N + 1;
  lli ans = 1;
  lli now = 0;
  for (int i = 0; i < M + 1; ++i) {
    lli distance = a[i] - 1 - now;
    ans = ans * calc[distance];
    now = a[i] + 1;
    ans %= 1000000007;
    if (i != 0 && a[i - 1] == a[i] - 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  cout << ans << endl;
  return 0;
}
