#include <bits/stdc++.h>
template <typename T1, typename T2>
inline void chmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
using namespace std;
class Solve {
 public:
  void input() {}
  void solve() {
    input();
    int N, M;
    cin >> N >> M;
    set<int> kiken;
    for (int i = int(0); i < int(M); i++) {
      int tmp;
      cin >> tmp;
      kiken.insert(tmp);
    }
    vector<long long int> dp(N + 1);
    dp[0] = 1;
    for (int i = 0; i < N; ++i) {
      if (!kiken.count(i)) {
        dp[i + 1] = (dp[i + 1] + dp[i]) % 1000000007;
        dp[i + 2] = (dp[i + 2] + dp[i]) % 1000000007;
      }
    }
    long long int ans = dp[N];
    cout << ans << endl;
  }
};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  Solve().solve();
  return 0;
}
