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

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> P;
typedef tuple<int,int,int> tpl;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
#define LB(a,x) lower_bound((a).begin(), (a).end(), x) - (a).begin()
#define UB(a,x) upper_bound((a).begin(), (a).end(), x) - (a).begin()

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a)-1;i>=(b);--i)
#define RREP(i,n) RFOR(i,n,0)

#define en "\n"

const double EPS = 1e-9;
const double PI  = acos(-1.0);
const int INT_INF = 2147483647;
const long long LL_INF = 1LL<<60;
const long long MOD = 998244353;

#define CLR(a) memset((a), 0, sizeof(a))

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

template<typename T>
struct SegmentTree {
	typedef function<T(T,T)> F;
    typedef function<T(T,T)> G;
    int n;
    F f;
    G g;
    T e;

    vector<T> val;

    SegmentTree(vector<T> a, F f_, G g_, T e):
        f(f_), g(g_), e(e){
            int sz = a.size();
            n = 1;

            while (n < sz) n <<= 1;
            val.resize(2 * n - 1, e);
            for (int i = 0; i < sz; i++) val[i + n - 1] = a[i];
            for (int i = n - 2; i >= 0; i--) val[i] = f(val[i * 2 + 1], val[i * 2 + 2]);
        }
    
        SegmentTree() {}

        void update(int pos, T v) {
            int k = pos + n - 1;
            val[k] = g(val[k], v);
            while (k > 0) {
                k = (k - 1) / 2;
                val[k] = f(val[k * 2 + 1], val[k * 2 + 2]);
            }
        }

        T get(int pos) {
            int k = pos + n - 1;
            return val[k];
        }

        T query(int a, int b, int k = 0, int l = 0, int r = -1) {
            if (r < 0) r = n;
            if (r <= a || b <= l) return e;
            if (a <= l && r <= b) return val[k];
            T lv = query(a, b, k * 2 + 1, l, (l + r) / 2);
            T rv = query(a, b, k * 2 + 2, (l + r) / 2, r);
            return f(lv, rv);
        }
};

struct mint {
    long long x;
    mint(long long x=0):x((x%MOD+MOD)%MOD){}
    mint operator-() const { return mint(-x);}
    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(long long 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;
    }
};

int main(void){
    auto f = [](ll a, ll b){return max(a,b);};
    auto g = [](ll a, ll b){return b;};
    ll N; cin >> N;
    vector<pair<ll,ll>> v(N); REP(i,N) cin >> v[i].first >> v[i].second;
    SORT(v);
    vector<ll> a(N); REP(i,N) a[i] = i+1;
    SegmentTree<ll> st(a, f, g, 0);

    auto lb = [&](ll val){
        ll l=0, r=N, n=(l+r)/2;
        while(r-l>1){
            if(v[n].first < val) l = n;
            else r = n;
            n = (l+r)/2;
        }
        return r;
    };

    RREP(i,N-1){
        ll it = lb(v[i].first + v[i].second);
        ll u = st.query(i,it);
        st.update(i,u);
    }

    mint dp[N+1]; dp[N] = 1;
    RREP(i,N){
        ll Ri = st.get(i);
        dp[i] = dp[Ri] + dp[i+1];
    }
    ll ans = dp[0].x;
    cout << ans << en;
    return 0;
}

Measured memory_bytes: 10624