#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int M = 1e9 + 7;
long long vis[N];
long long dp[N];
int main() {
  long long n, m;
  cin >> n >> m;
  long long x;
  while (m--) {
    cin >> x;
    vis[x] = 1LL;
  }
  dp[0] = 1LL;
  dp[1] = 1LL;
  for (long long i = 2; i <= n; i++) {
    if (vis[i - 1] == 0 and vis[i - 2] == 0)
      dp[i] = min(dp[i - 1], dp[i - 2]) + 1;
    else if (vis[i - 1] == 0)
      dp[i] = dp[i - 2] + 1;
    else if (vis[i - 2] == 0)
      dp[i] = (dp[i - 1]) + 1;
    else if (vis[i - 1] == 1 and vis[i - 2] == 1) {
      cout << 0 << endl;
      return 0;
    }
  }
  cout << dp[n] % M << endl;
  return 0;
}
