#include <bits/stdc++.h>
using namespace std;
class Stairs {
 public:
  Stairs(long long N);
  ~Stairs();
  long long main_calc(long long ai, long long ag);

 private:
  void recursive(long long ai, long long ag);
  const long long N;
  long long cnt = 0;
  long long ans = 1;
  const long long cval = 1000000007;
};
Stairs::Stairs(long long N) : N(N) {
  cnt = 0;
  ans = 1;
}
Stairs::~Stairs() {}
void Stairs::recursive(long long ai, long long ag) {
  if (ai == ag) {
    cnt += 1;
  } else if (ai > ag) {
    return;
  } else {
    recursive(ai + 1, ag);
    recursive(ai + 2, ag);
  }
}
long long Stairs::main_calc(long long ai, long long ag) {
  cnt = 0;
  recursive(ai, ag);
  ans = ((ans % cval) * (cnt % cval)) % cval;
  return ans;
}
int main() {
  long long N;
  long long M;
  cin >> N >> M;
  long long ab = 0;
  long long aa = 0;
  Stairs st(N);
  for (long long i = 1; i <= M; i++) {
    cin >> aa;
    st.main_calc(ab, aa - 1);
    ab = aa + 1;
  }
  long long ans = st.main_calc(ab, N);
  cout << ans << endl;
  return 0;
}
