#include <bits/stdc++.h>
using namespace std;
int standerd = 1000000007;
string ans_Yes = "Yes";
string ans_No = "No";
string ans_yes = "yes";
string ans_no = "no";
long long cnt;
long long calccnt(long long cnt) {
  if (cnt == 1)
    return 1;
  else if (cnt == 0)
    return 1;
  else
    return (calccnt(cnt - 1) + calccnt(cnt - 2)) % standerd;
  ;
}
int main() {
  int N, M;
  cin >> N;
  cin >> M;
  int a[M];
  for (int mi = 0; mi < (M); mi++) cin >> a[mi];
  long long ans = 1;
  int mi;
  mi = 0;
  cnt = 0;
  int ni = 0;
  if (M == 0) {
    ans = (ans * calccnt(cnt)) % standerd;
    cout << ans << endl;
  } else {
    if (a[mi] == 1) {
      ni = 2;
      mi++;
    }
    while (ni <= N) {
      if (ni == a[mi]) {
        ans = (ans * calccnt(cnt - 1)) % standerd;
        mi++;
        cnt = 0;
      } else {
        cnt++;
      }
      ni++;
    }
    ans = (ans * calccnt(cnt - 1)) % standerd;
    cout << ans << endl;
  }
}
