#include <bits/stdc++.h>
#define ll long long int
#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL)
#define endl '\n'
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end() 
#define max_pqueue priority_queue< long long >
#define min_pqueue priority_queue< long long , vector<long long> , greater< long long >>
#define vi vector<int>
#define vii vector<pair<int, int>>
#define vl vector<long long>
#define vll vector<pair<long long, long long>>
#define FF first
#define SS second

//~ setbase - cout << setbase (16); cout << 100 << endl; Prints 64
//~ setfill -   cout << setfill ('x') << setw (5); cout << 77 << endl; prints xxx77
//~ setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx
//~ cout.precision(x)  cout<<fixed<<val;  // prints x digits after decimal in val

#ifndef LOCAL_MACHINE
#define cerr if (false) cerr
#endif

using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
template<typename T>
void _printA(T *t, long long sz) { cout<<" { "; for (long long i=0; i<sz; i++) cout<<"["<<i<<"] = "<< t[i]<<endl; cout<<" } \n";}
#ifdef LOCAL_MACHINE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#define debugA(x, y) cerr << "[" << #x << "] = "; _printA(x, y)
#else
#define debug(x...)
#define debugA(x, y)
#endif

const ll _MOD =   998244353LL;

ll mod(ll a, ll m=_MOD) {
	return (a + m) % m;
}

ll gcd(ll a, ll b) { return __gcd(a, b); }

ll gcd(ll a, ll b, ll & x, ll & y) {
    if (a == 0) {
        x = 0;
        y = 1;
        return b;
    }
    ll x1, y1;
    ll d = gcd(b % a, a, x1, y1);
    x = y1 - (b / a) * x1;
    y = x1;
    return d;
}

ll modinv(ll a, ll m=_MOD) {
	ll x, y;
	gcd(a, m, x, y);
	x = (x % m + m) % m;
    return x;
}

/* ------------------------------------------------------------------ */

struct robot {
	ll x, d;
};

bool robot_sort(const robot a, const robot b) {
	return a.x < b.x;
}

ll sgt[4*2*(int)1e5];

void build(int v, int l, int r, ll *ar) {
	if (l == r) {
		sgt[v] = ar[l];
		return;
	}
	int mid = (l + r)/2;
	build(2*v, l, mid, ar);
	build(2*v+1, mid+1, r, ar);
	sgt[v] = max(sgt[2*v], sgt[2*v+1]);
}

ll maxq(int v, int l, int r, int ql, int qr) {
	debug(v, l, r, ql, qr);
	if (ql > qr)
		return -1;
	if (l == ql and r == qr)
		return sgt[v];
	int mid = (l + r)/2;
	ll a = maxq(2*v, l, mid, ql, min(mid, qr));
	ll b = maxq(2*v+1, mid+1, r, max(mid+1, ql), qr);
	return max(a, b);
}

void update(int v, int l, int r, int pos, ll val) {
	if (l == r) {
		sgt[v] = val;
		return;
	}
	int mid = (l + r)/2;
	if (pos <= mid)
		update(2*v, l, mid, pos, val);
	else
		update(2*v+1, mid+1, r, pos, val);
	sgt[v] = max(sgt[2*v], sgt[2*v+1]);
}


vector<ll> rng(2*(int)1e5 + 5);
void solve() {
	ll N;
	cin>>N;
	vector<robot> r;
	for (int i=0; i<N; i++) {
		ll x, d;
		cin>>x>>d;
		r.pb({x, d});
	}
	//~ cout<<"done";
	//~ return;
	sort(r.begin(), r.end(), robot_sort);
	//~ cout<<"boo";
	//~ return ;
	update(1, 0, N-1, N-1, N-1);
	//~ return;
	for (int i=N-2; i>=0; i--) {
		//~ cout<<r[i].x + r[i].d<<endl;
		struct robot rr = {r[i].x + r[i].d, 0};
		int idx = lower_bound(r.begin(), r.end(), rr, robot_sort) - r.begin();
		idx--;
		rng[i] = i;
		if (i != idx)
			rng[i] = maxq(1, 0, N-1, i, idx);
		debug(i , rng[i]);
		update(1, 0, N-1, i, rng[i]);
	}
	
	// 0 killed
	// 1 alive
	static ll dp[2*(int)1e5+5][2];
	fill((ll*)dp, (ll*)dp + sizeof(dp)/8, -1);
	dp[N-1][0] = dp[N-1][1] = 1;
	
	for (int i=N-2; i>=0; i--) {
		if (rng[i] < N - 1)
			dp[i][0] = mod(dp[rng[i]+1][0] +  dp[rng[i]+1][1]);
		else
			dp[i][0] = 1;
		dp[i][1] = mod(dp[i+1][1] + dp[i+1][0]); 
	}
	
	cout<<mod(dp[0][0] + dp[0][1])<<endl;
}

int main() {
#ifdef LOCAL_MACHINE
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-result"
freopen("in", "r", stdin);
#pragma GCC diagnostic pop
#endif
	
	fast_io;
	ll T;
	T = 1;
	//~ cin>>T;
	for (ll t=0; t<T; t++) {
		solve();
	}
}	











Measured memory_bytes: 15340