#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T, class U> using Pa = pair<T, U>;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;

constexpr ll mod = 998244353;
struct mint {
    ll x;
    mint(ll x=0):x((x%mod+mod)%mod){}
    
    friend ostream &operator<<(ostream& os,const mint& a){
        return os << a.x;
    }

    friend istream &operator>>(istream& is,mint& a){
        ll t;
        is >> t;
        a = mint(t);
        return (is);
    }

    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod-a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const {
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint a) const {
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint a) const {
        mint res(*this);
        return res*=a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }
    // for prime mod
    mint inv() const {
        return pow(mod-2);
    }
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint a) const {
        mint res(*this);
        return res/=a;
    }
};

template<class T>
class Compress {
    int N;
    map<T,int> idx;
    map<int,T> value;
    vec<T> v;
    vec<T> cmp;
public:
    Compress(){}
    void add(T x){v.push_back(x);}
    void build(){
        for(auto &x:v) cmp.push_back(x);
        sort(cmp.begin(),cmp.end());
        cmp.erase(unique(cmp.begin(),cmp.end()),cmp.end());
        N = cmp.size();
        for (int i=0;i<N;i++) idx[cmp[i]] = i;
    }
    int id(T val) {return idx[val];}
    T val(int id) {return cmp[id];}
    int size(){return N;};
};


template<typename Monoid,typename F>
class SegmentTree{
private:
    int sz;
    vector<Monoid> seg;
    const F op;
    const Monoid e;
public:
    SegmentTree(int n,const F op,const Monoid &e):op(op),e(e){
        sz = 1;
        while(sz<=n) sz <<= 1;
        seg.assign(2*sz,e);
    }
    void set(int k, const Monoid &x){
        seg[k+sz] = x;
    }
    void build(){
        for(int i=sz-1;i>0;i--){
            seg[i] = op(seg[2*i],seg[2*i+1]);
        }
    }
    void update(int k,const Monoid &x){
        k += sz;
        seg[k] = x;
        while(k>>=1){
            seg[k] = op(seg[2*k],seg[2*k+1]);
        }
    }
    Monoid query(int l,int r){
        Monoid L = e,R = e;
        for(l+=sz,r+=sz;l<r;l>>=1,r>>=1){
            if(l&1) L = op(L,seg[l++]);
            if(r&1) R = op(seg[--r],R);
        }
        return op(L,R);
    }
};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vec<int> L(N),R(N);
    Compress<int> cmp;
    for(int i=0;i<N;i++){
        int x,d;
        cin >> x >> d;
        L[i] = x,R[i] = x+d;
        cmp.add(L[i]),cmp.add(R[i]);
    }
    cmp.build();
    auto op = [&](int a,int b){return max(a,b);};
    int inf = 2e9;
    SegmentTree<int,decltype(op)> seg(N+1,op,-inf);
    vec<int> idx(N);
    iota(idx.begin(),idx.end(),0);
    sort(idx.begin(),idx.end(),[&](int i,int j){
        return (L[i]!=L[j]? L[i]<L[j]:R[i]<R[j]);
    });
    sort(L.begin(),L.end());
    L.push_back(inf);
    vec<int> ne(N);
    for(int _=N-1;_>=0;_--){
        int i = idx[_];
        int now = R[i];
        int r = lower_bound(L.begin(),L.end(),now)-L.begin();
        now = max(now,seg.query(_,r));
        seg.update(_,now);
        ne[_] = now;
//        cerr << _ << " " << r << " " << R[i] << " " << now << "\n";
    }
    vec<mint> dp(N+1,0);
    dp[0] = 1;
    for(int i=0;i<N;i++){
        dp[i+1] += dp[i];
        int r = lower_bound(L.begin(),L.end(),ne[i])-L.begin();
        dp[r] += dp[i];
    }
//    for(int i=0;i<=N;i++) cerr << dp[i] << (i!=N? " ":"\n");
    cout << dp[N] << "\n";
}

Measured memory_bytes: 28896