#include <bits/stdc++.h>
using namespace std;
inline void IN(void) { return; }
template <typename First, typename... Rest>
void IN(First &first, Rest &...rest) {
  cin >> first;
  IN(rest...);
  return;
}
inline void OUT(void) {
  cout << "\n";
  return;
}
template <typename First, typename... Rest>
void OUT(First first, Rest... rest) {
  cout << first << " ";
  OUT(rest...);
  return;
}
template <typename T>
void vec_print(vector<T> VEC) {
  for (long long i = (long long)0; i < (long long)VEC.size(); ++i) {
    cout << VEC[i] << " ";
  }
  cout << "\n";
};
template <typename T>
void mat_print(vector<vector<T>> MAT) {
  for (long long i = (long long)0; i < (long long)MAT.size(); ++i) {
    for (long long j = (long long)0; j < (long long)MAT[i].size(); ++j) {
      cout << MAT[i][j] << " ";
    }
    cout << "\n";
  }
};
template <typename CLASS1, typename CLASS2>
class HOGE {
 public:
  CLASS1 key;
  CLASS2 value;
  HOGE(void) { return; };
  HOGE(CLASS1 key, CLASS2 value) {
    this->key = key;
    this->value = value;
  };
  ~HOGE(void) { return; };
  void print(void) {
    cout << "key : " << key << ", value : " << value << "\n";
    return;
  };
  bool operator==(const HOGE &obj) { return (this->value == obj.value); };
  bool operator<(const HOGE &obj) { return (this->value < obj.value); };
  bool operator>(const HOGE &obj) { return (this->value > obj.value); };
};
template <typename CLASS1, typename CLASS2>
bool operator==(const HOGE<CLASS1, CLASS2> &hoge1,
                const HOGE<CLASS1, CLASS2> &hoge2) {
  return hoge1.value == hoge2.value;
};
template <typename CLASS1, typename CLASS2>
bool operator<(const HOGE<CLASS1, CLASS2> &hoge1,
               const HOGE<CLASS1, CLASS2> &hoge2) {
  return hoge1.value < hoge2.value;
};
template <typename CLASS1, typename CLASS2>
bool operator>(const HOGE<CLASS1, CLASS2> &hoge1,
               const HOGE<CLASS1, CLASS2> &hoge2) {
  return hoge1.value > hoge2.value;
};
constexpr int INF = (1 << 30);
constexpr long long INFLL = 1LL << 62;
constexpr long double EPS = 1e-12;
constexpr long long MOD = (long long)((1E+9) + 7);
long long N, M;
vector<long long> a;
vector<long long> dp;
long long search(long long pos) {
  if (dp[pos] >= 0) return dp[pos];
  if (pos == N) return 1;
  if (pos > N) return 0;
  long long tmp = *lower_bound(a.begin(), a.end(), pos);
  if (tmp == pos) return 0;
  if (tmp == pos + 1) return dp[pos] = search(pos + 2) % MOD;
  if (tmp == pos + 2) return dp[pos] = search(pos + 1) % MOD;
  return dp[pos] = (search(pos + 1) + search(pos + 2)) % MOD;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  IN(N, M);
  a.resize(M);
  for (long long i = (long long)0; i < (long long)M; ++i) IN(a[i]);
  for (long long i = (long long)0; i < (long long)M - 1; ++i) {
    if (a[i + 1] - a[i] == 1) {
      OUT("0");
      return 0;
    }
  }
  dp.resize(N + 1, -1);
  OUT(search(0));
  return 0;
}
