#include <bits/stdc++.h>
const long long mod = 998244353ll;
int can[200005];
long long mem[200005];
int jump[25], jcnt;
long long re(int x, int n) {
  if (x == n) return 1ll;
  if (mem[x] >= 1ll) return mem[x];
  for (int i = 1; i <= jcnt; i++)
    if (x + jump[i] <= n) mem[x] += re(x + jump[i], n);
  return mem[x];
}
int main() {
  int n, k;
  long long ans = 0ll;
  int a, b;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= k; i++) {
    scanf("%d%d", &a, &b);
    can[a] = 1;
    can[b] = 1;
  }
  for (int i = 1; i <= n; i++)
    if (can[i]) jump[++jcnt] = i;
  ans = re(1, n);
  printf("%lld", ans % mod);
  return 0;
}
