#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1e18

template <std::uint_fast64_t mod>
class ModInt {
    using u64 = std::uint_fast64_t;

   public:
    u64 x;
    ModInt(const ll x = 0) : x(x < 0 ? (mod - (-x % mod)) % mod : x % mod) {}

    ModInt operator+(const ModInt r) { return ModInt(*this) += r; }
    ModInt operator*(const ModInt r) { return ModInt(*this) *= r; }
    ModInt operator-(const ModInt r) { return ModInt(*this) -= r; }
    ModInt operator/(const ModInt r) { return ModInt(*this) /= r; }
    ModInt operator-() { return ModInt(mod - x); }

    ModInt &operator+=(const ModInt r) {
        x += r.x;
        if (x >= mod) x -= mod;
        return *this;
    }
    ModInt &operator-=(const ModInt r) {
        if (x < r.x) x += mod;
        x -= r.x;
        return *this;
    }
    ModInt &operator*=(const ModInt r) {
        x *= r.x;
        if (x >= mod) x %= mod;
        return *this;
    }
    ModInt &operator/=(ModInt r) {
        if (!(x % r.x)) {
            x /= r.x;
            return *this;
        }
        u64 p = mod - 2;
        while (p > 0) {
            if (p & 1) *this *= r;
            r *= r;
            p >>= 1;
        }
        return *this;
    }
    ModInt &operator++(int) { return (*this) += 1; }
    ModInt &operator++() { return (*this) += 1; }
    ModInt &operator--(int) { return (*this) -= 1; }
    ModInt &operator--() { return (*this) -= 1; }

    bool operator<(const ModInt r) { return x < r.x; }
    bool operator>(const ModInt r) { return x > r.x; }
    bool operator<=(const ModInt r) { return x <= r.x; }
    bool operator>=(const ModInt r) { return x >= r.x; }
    bool operator==(const ModInt r) { return x == r.x; }
    bool operator!=(const ModInt r) { return x != r.x; }

    ModInt inv() { return (ModInt)1 / (*this); }
    int get_mod() { return mod; }

    friend std::istream &operator>>(std::istream &in, ModInt &m) {
        ll a;
        in >> a;
        if (a < 0) a = mod - (-a % mod);
        if (a >= mod) a %= mod;
        m.x = a;
        return in;
    }
    friend std::ostream &operator<<(std::ostream &out, const ModInt &m) {
        out << m.x;
        return out;
    }
};
constexpr std::uint_fast64_t mod = 998244353;
using mint = ModInt<mod>;

template <typename T>
class Segment {
    using u32 = uint_fast32_t;
    u32 n;
    vector<T> node;
    T e;                  // 単位元∧初期値
    function<T(T, T)> f;  // 更新
    function<T(T, T)> g;  // 取得

   public:
    Segment(u32 N, T e, function<T(T, T)> f, function<T(T, T)> g, vector<T> v = vector<T>())
        : e(e), f(f), g(g) {
        n = 1;
        while (n < N) n *= 2;
        node.assign(2 * n - 1, e);
        if (N == (u32)v.size()) {
            for (int i = 0; i < N; i++) node[i + n - 1] = v[i];
            for (int i = n - 2; i >= 0; i--) {
                node[i] = g(node[2 * i + 1], node[2 * i + 2]);
            }
        }
    }

    // k番目をaで更新
    void update(u32 k, T a) {
        k += n - 1;
        node[k] = f(node[k], a);
        while (k > 0) {
            k = (k - 1) / 2;
            node[k] = g(node[2 * k + 1], node[2 * k + 2]);
        }
    }

    // [a,b)の区間取得
    T get(u32 a, u32 b, u32 k, u32 l, u32 r) {
        if (r < 0) r = n;
        if (r <= a || b <= l) return e;  // 含まない
        if (a <= l && r <= b)            // 完全に含む
            return node[k];
        else {
            T vl = get(a, b, 2 * k + 1, l, (l + r) / 2);
            T vr = get(a, b, 2 * k + 2, (l + r) / 2, r);
            return g(vl, vr);
        }
    }
    T get(u32 a, u32 b) { return get(a, b, 0, 0, n); }

    T operator[](u32 i) { return node[i + n - 1]; }
};

struct Robot {
    int X, D;
};

bool operator<(const Robot &x0, const Robot &x1) { return x0.X < x1.X; }

int main() {
    int N;
    cin >> N;
    vector<Robot> v(N);
    for (int i = 0; i < N; i++) {
        cin >> v[i].X >> v[i].D;
    }
    sort(v.begin(), v.end());

    auto f = [](int a, int b) { return b; };
    auto g = [](int a, int b) { return max(a, b); };
    Segment<int> tree(N, -1, f, g);
    for (int i = 0; i < N; i++) tree.update(i, i);
    for (int i = N - 2; i >= 0; i--) {
        int j = lower_bound(v.begin(), v.end(), Robot{v[i].X + v[i].D, -1}) - v.begin();
        if (i < j) tree.update(i, tree.get(i, j));
    }

    vector<mint> dp(N + 1, 1);
    for (int i = N - 1; i >= 0; i--) {
        dp[i] = dp[i + 1] + dp[tree.get(i, i + 1) + 1];
    }
    cout << dp[0] << endl;
    return 0;
}

Measured memory_bytes: 5376