#include <bits/stdc++.h>
using namespace std;
long long mod = 998244353;
long long arr[(long long)2e5 + 5];
long long as;
void input() {
  cin >> as;
  for (long long i = 0; i < as; ++i) cin >> arr[i];
}
void q1() {
  long long a[] = {1, 1, 1, 2, 1, 2, 1, 5,  2, 2, 1, 5, 1, 2, 1, 14,
                   1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
  long long k;
  cin >> k;
  --k;
  cout << a[k] << "\n";
}
void q2() {
  long long h, w;
  cin >> h >> w;
  h *= w;
  ++h;
  h /= 2;
  cout << h << "\n";
}
void q3() {
  long long a, b;
  cin >> a >> b;
  for (long long i = 1; i <= 100000; ++i) {
    long long x = i * 8;
    x /= 100;
    long long y = i * 10;
    y /= 100;
    if (x == a && y == b) {
      cout << i;
      return;
    }
  }
  cout << -1;
}
void q4() {
  string s;
  cin >> s;
  deque<long long> q;
  for (long long i = 0; i < s.size(); ++i) q.push_back(s[i]);
  long long Q;
  cin >> Q;
  long long curr = 0;
  while (Q--) {
    long long t;
    cin >> t;
    if (t == 1) {
      curr = 1 - curr;
    } else {
      long long f;
      char c;
      cin >> f >> c;
      if (curr == 0 && f == 1)
        q.push_front(c);
      else if (curr == 0 && f == 2)
        q.push_back(c);
      else if (curr == 1 && f == 1)
        q.push_back(c);
      else
        q.push_front(c);
    }
  }
  string ret = "";
  while (!q.empty()) {
    ret += q.front();
    q.pop_front();
  }
  if (curr) reverse(ret.begin(), ret.end());
  cout << ret;
  return;
}
void q5() {
  long long n, p;
  cin >> n >> p;
  string s;
  cin >> s;
  long long ans = 0;
  if (p == 2 || p == 5) {
    for (long long i = 0; i < n; ++i)
      if ((s[i] - '0') % p == 0) ans += i + 1;
  } else {
    long long tt = 1;
    long long curr = 0;
    map<long long, long long> mp;
    mp[0]++;
    for (long long i = n - 1; i >= 0; --i) {
      curr += (s[i] - '0') * tt;
      tt *= 10;
      ans += mp[curr];
      ++mp[curr];
    }
  }
  cout << ans;
}
long long mod2 = 998244353;
void solve() {
  long long n;
  cin >> n;
  array<long long, 2> array[n];
  for (long long i = 0; i < n; ++i) cin >> array[i][0] >> array[i][1];
  sort(array, array + n);
  long long dp[n + 1];
  dp[n] = 1;
  stack<long long> id, dis;
  id.push(n);
  dis.push((long long)2e10);
  for (long long i = n - 1; i >= 0; --i) {
    while (dis.top() < array[i][0] + array[i][1]) {
      dis.pop();
      id.pop();
    }
    long long j = id.top();
    dp[i] = dp[j];
    dp[i] %= mod2;
    dp[i] += dp[i + 1];
    dp[i] %= mod2;
    id.push(i);
    dis.push(array[i][0]);
  }
  cout << dp[0];
}
int32_t main() {
  long long t;
  t = 1;
  while (t--) solve();
  return 0;
}
