#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7, MOD = 998244353;
const int dx[] = {0, 0, -1, 1}, dy[] = {-1, 1, 0, 0};
int u, v, p, d, n, tc, q, k, l, r, c, m, b[N], cnt, curr, a[N], ans;
long long calc[N];
bool sum[N], bad[N];
char s[N];
bool ok(int x) { return (x >= 0 && !bad[x]); }
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0, x; i < m; i++) {
    scanf("%d", &x);
    bad[x] = 1;
  }
  calc[0] = 1;
  for (int i = 1; i <= n; i++) {
    if (ok(i - 1)) {
      calc[i] += calc[i - 1];
      calc[i] %= MOD;
    }
    if (ok(i - 2)) {
      calc[i] += calc[i - 2];
      calc[i] %= MOD;
    }
  }
  printf("%lld\n", calc[n]);
}
