#include <bits/stdc++.h>
using namespace std;
const int m = 1000000007;
int main(void) {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  vector<int> dp(N + 1, 1 << 30);
  dp[1] = 1;
  dp[2] = 1;
  for (int i = (0); i < (M); ++i) {
    cin >> a[i];
    dp[a[i]] = -1;
  }
  long long ans = 0;
  for (int i = (3); i < (N + 1); ++i) {
    if (dp[i] == -1 and dp[i - 1] == -1) {
      ans = 0;
      break;
    }
    if (dp[i] != -1 and dp[i - 1] != -1) {
      dp[i] = min(dp[i], dp[i - 1] + 1);
      ans = (ans + 1) % m;
    }
    if (dp[i] != -1 and dp[i - 2] != -1) {
      dp[i] = min(dp[i], dp[i - 2] + 1);
      ans = (ans + 1) % m;
    }
  }
  cout << ans << endl;
  return 0;
}
