#include <bits/stdc++.h>
using namespace std;
constexpr int64_t mod = 998244353;

template <uint32_t mod>
class modint{
    uint64_t value;
public:
    constexpr modint(const int64_t x=0) noexcept: value(x % mod + (x < 0 ? mod : 0)){ }
    constexpr explicit operator uint64_t() const noexcept{ return value; }
    constexpr modint inverse() const noexcept{ return pow(*this, mod-2); }
    constexpr bool operator==(const modint &rhs) const noexcept{ return value == rhs.value; }
    constexpr bool operator!=(const modint &rhs) const noexcept{ return value != rhs.value; }
    constexpr modint operator+() const noexcept{ return modint(*this); }
    constexpr modint operator-() const noexcept{ return modint(mod - value); }
    constexpr modint operator+(const modint &rhs) const noexcept{ return modint(*this) += rhs; }
    constexpr modint operator-(const modint &rhs) const noexcept{ return modint(*this) -= rhs; }
    constexpr modint operator*(const modint &rhs) const noexcept{ return modint(*this) *= rhs; }
    constexpr modint operator/(const modint &rhs) const noexcept{ return modint(*this) /= rhs; }
    constexpr modint &operator+=(const modint &rhs) noexcept{
        if((value += rhs.value) >= mod) value -= mod;
        return *this;
    }
    constexpr modint &operator-=(const modint &rhs) noexcept{ return *this += mod - rhs.value; }
    constexpr modint &operator*=(const modint &rhs) noexcept{
        if((value *= rhs.value) >= mod) value %= mod;
        return *this;
    }
    constexpr modint &operator/=(const modint &rhs) noexcept{ return *this *= rhs.inverse(); }
    constexpr modint operator++(int) noexcept{
        modint ret(*this);
        if((++value) >= mod) value -= mod;
        return ret;
    }
    constexpr modint operator--(int) noexcept{
        modint ret(*this);
        if((value += mod - 1) >= mod) value -= mod;
        return ret;
    }
    constexpr modint &operator++() noexcept{ return *this += 1; }
    constexpr modint &operator--() noexcept{ return *this -= 1; }
    friend std::ostream &operator<<(std::ostream &os, const modint<mod> &x){ return os << x.value; }
    friend std::istream &operator>>(std::istream &is, modint<mod> &x){
        int64_t i;
        is >> i;
        x = modint<mod>(i);
        return is;
    }
    friend constexpr modint<mod> pow(const modint<mod> &x, uint64_t y){
        modint<mod> ret{1}, m{x};
        while(y > 0){
            if(y & 1) ret *= m;
            m *= m;
            y >>= 1;
        }
        return ret;
    }
};

class segment_tree{
    int tree[400000];
    int len;
public:
    segment_tree(int n): len(n){
        for(int i=0;i<n*2;++i) tree[i] = 0;
    }
    void set(int pos, int val){
        pos += len;
        tree[pos] = val;
        for(pos >>= 1; pos > 0; pos >>= 1){
            tree[pos] = max(tree[pos<<1 | 0], tree[pos<<1 | 1]);
        }
    }
    int get(int left, int right){
        int ret = 0;
        left += len; right += len;
        while(left < right){
            if(left  & 1){ ret = max(ret, tree[left]); ++left; }
            if(right & 1){ --right; ret = max(ret, tree[right]); }
            left >>= 1; right >>= 1;
        }
        return ret;
    }
};

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    
    int n;
    static pair<int64_t, int64_t> pos[200000];
    static int nx[200000];
    cin >> n;
    for(int i=0;i<n;++i){
        int x, d;
        cin >> x >> d;
        pos[i] = {x, d};
    }
    sort(pos, pos + n);

    nx[n-1] = n;
    segment_tree st(n);
    st.set(n-1, n);

    for(int i=n-2;i>=0;--i){
        int l = i, r = n;
        auto target = pos[i].first + pos[i].second;
        while(r-l > 1){
            int mid = (l + r) / 2;
            if(target <= pos[mid].first) r = mid;
            else l = mid;
        }
        nx[i] = max(i+1, st.get(i+1, l+1));
        st.set(i, nx[i]);
    }

    modint<mod> dp[200001];
    dp[0] = 1;
    for(int i=0;i<n;++i){
        dp[i+1] += dp[i];
        dp[nx[i]] += dp[i];
    }
    cout << dp[n] << endl;

    return 0;
}

Measured memory_bytes: 7296