#include <bits/stdc++.h>
using namespace std;
long pattern(long n) {
  if (n == 0)
    return 1;
  else if (n == 1)
    return 1;
  else if (n == 2)
    return 2;
  else if (n < 0)
    return 0;
  else
    return pattern(n - 1) + pattern(n - 2);
}
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;
  long ans = 1;
  for (int i = 0; i <= M; i++) {
    ans *= pattern(broken[i + 1] - broken[i] - 2);
    ans %= 1000000007;
  }
  cout << ans << endl;
  return 0;
}
