#include <bits/stdc++.h>
using namespace std;

#include <bits/stdc++.h>
using namespace std;

template <typename T>
class SegmentTree
{
    vector<T> arr;
    T initial_value;
    long long size;
    function<T(T, T)> operation;

public:
    SegmentTree(const long long N, const function<T(T, T)> func, const T init)
    {
        long long n = 1;
        while (n < N + 1)
        {
            n *= 2;
        }
        set_size(n);
        set_initial_value(init);
        initialize_array();
        set_operation(func);
    }

    void set_size(const long long N)
    {
        this->size = N;
    }

    void set_initial_value(const T init)
    {
        this->initial_value = init;
    }

    void initialize_array()
    {
        this->arr = vector<T>(2 * this->size - 1, this->initial_value);
    }

    void initialize_array(const T init)
    {
        set_initial_value(init);
        initialize_array();
    }

    void set_operation(const function<T(T, T)> func)
    {
        this->operation = func;
    }

    void update(const long long idx, const T value)
    {
        long long modify_idx = idx;
        modify_idx += this->size - 1;
        this->arr[modify_idx] = value;
        while (modify_idx > 0)
        {
            modify_idx = (modify_idx - 1) / 2;
            this->arr[modify_idx] = this->operation(this->arr[modify_idx * 2 + 1], this->arr[modify_idx * 2 + 2]);
        }
    }

    T query(const long long idx) const
    {
        return this->arr[idx + this->size - 1];
    }

    T query(const long long idx_a, const long long idx_b) const
    {
        if (idx_a == idx_b)
        {
            return this->query(idx_a);
        }
        else
        {
            return this->query(idx_a, idx_b, 0, 0, this->size);
        }
    }

    T query(const long long a, const long long b, const long long k, const long long l, const long long r) const
    {
        if (r <= a || b <= l)
        {
            return this->initial_value;
        }
        if (a <= l && r <= b)
        {
            return this->arr[k];
        }
        else
        {
            return this->operation(
                this->query(a, b, 2 * k + 1, l, (l + r) / 2),
                this->query(a, b, 2 * k + 2, (l + r) / 2, r));
        }
    }

    T operator[](const long long idx) const
    {
        return this->arr[idx + this->size - 1];
    }
};

template <long long mod>
class Mod
{
    long long value;
    void set_value(const long long x)
    {
        this->value = x % mod;
    }

public:
    Mod()
    {
        set_value(0ll);
    }

    template <typename T>
    Mod(T x = 0)
    {
        set_value((long long)x);
    }

    friend istream &operator>>(istream &is, Mod &x)
    {
        long long tmp;
        is >> tmp;
        x.set_value(tmp);
        return is;
    }

    friend ostream &operator<<(ostream &os, const Mod &x)
    {
        os << x.value;
        return os;
    }

    operator long long() const
    {
        return this->value;
    }

    template <typename T>
    bool operator<(const T x)
    {
        return this->value < (long long)x;
    }

    template <typename T>
    bool operator<=(const T x)
    {
        return this->value <= (long long)x;
    }

    template <typename T>
    bool operator>(const T x)
    {
        return this->value > (long long)x;
    }

    template <typename T>
    bool operator>=(const T x)
    {
        return this->value >= (long long)x;
    }

    template <typename T>
    bool operator==(const T x)
    {
        return this->value == (long long)x;
    }

    template <typename T>
    Mod &operator=(const T x)
    {
        set_value((long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator&=(const T x)
    {
        set_value(this->value & (long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator|=(const T x)
    {
        set_value(this->value | (long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator^=(const T x)
    {
        set_value(this->value ^ (long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator<<=(const T x)
    {
        set_value(this->value << (long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator>>=(const T x)
    {
        set_value(this->value >> (long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator+=(const T x)
    {
        set_value(this->value + (long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator-=(const T x)
    {
        set_value(this->value - (long long)x + mod);
        return *this;
    }

    template <typename T>
    Mod &operator*=(const T x)
    {
        set_value(this->value * (long long)x);
        return *this;
    }

    template <typename T>
    Mod &operator/=(const T x)
    {
        long long a = (long long)x;
        long long b = mod;
        long long u = 1;
        long long v = 0;
        while (b)
        {
            long long t = a / b;
            a -= t * b;
            swap(a, b);
            u -= t * v;
            swap(u, v);
        }
        u %= mod;
        if (u < 0)
            u += mod;
        *this *= Mod(u);
        return *this;
    }

    template <typename T>
    Mod operator&(const T x) const
    {
        return Mod(*this) &= x;
    }

    template <typename T>
    Mod operator|(const T x) const
    {
        return Mod(*this) |= x;
    }

    template <typename T>
    Mod operator^(const T x) const
    {
        return Mod(*this) ^= x;
    }

    template <typename T>
    Mod operator<<(const T x) const
    {
        return Mod(*this) <<= x;
    }

    template <typename T>
    Mod operator>>(const T x) const
    {
        return Mod(*this) >>= x;
    }

    template <typename T>
    Mod operator+(const T x) const
    {
        return Mod(*this) += x;
    }

    template <typename T>
    Mod operator-(const T x) const
    {
        return Mod(*this) -= x;
    }

    template <typename T>
    Mod operator*(const T x) const
    {
        return Mod(*this) *= x;
    }

    template <typename T>
    Mod operator/(const T x) const
    {
        return Mod(*this) /= x;
    }

    Mod &operator++()
    {
        *this += 1;
        return *this;
    }

    Mod &operator--()
    {
        this->set_value(--this->value);
        return *this;
    }

    Mod operator++(auto)
    {
        Mod ret(*this);
        ++*this;
        return ret;
    }

    Mod operator--(auto)
    {
        Mod ret(*this);
        --*this;
        return ret;
    }
};

int main()
{
    const long long MOD = 998'244'353;
    int N;
    cin >> N;

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

    SegmentTree<int> st(
        N,
        [](int a, int b) { return max(a, b); },
        INT_MIN);
    for (int i = N - 1; i >= 0; i--)
    {
        int x = X[i];
        int d = XD[i].second;
        int r = distance(X.begin(), lower_bound(X.begin(), X.end(), x + d));
        st.update(i, max(i, st.query(i, r)));
    }

    vector<Mod<MOD>> dp(N + 1, 0);
    dp.back() = 1;
    for (int i = N - 1; i >= 0; i--)
    {
        dp[i] = dp[i + 1] + dp[st[i] + 1];
    }
    cout << dp.front() << endl;
}


Measured memory_bytes: 7040