#include<cstdio>
#include<cstring>
#include<cmath>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<queue>

using namespace std;

using ll=long long;
using vi=vector<int>;
using vvi=vector<vi>;
using pii=pair<int,int>;
using vll=vector<ll>;
using vvll=vector<vll>;
using vpii=vector<pii>;

#define PI 3.1415926535897932384626433832795


using ll=long long;

class mod_ll
{
public:
	ll m_v;
	static const ll m_m=998244353; // prime value ex. 1000000009
	mod_ll(ll v=0) : m_v(v) {}
	mod_ll operator = (ll rhs)
	{
		m_v=rhs%m_m;
		return *this;
	}
	ll operator ()(){return m_v;}
	mod_ll operator = (mod_ll rhs)
	{
		m_v=rhs.m_v;
		return *this;
	}
	mod_ll operator += (ll rhs)
	{
		m_v=(m_v+rhs)%m_m;
		return *this;
	}
	mod_ll operator += (mod_ll rhs)
	{
		m_v=(m_v+rhs.m_v)%m_m;
		return *this;
	}
	mod_ll operator + (mod_ll rhs)
	{
		auto ret=*this;
		return ret+=rhs;
	}
	mod_ll operator -= (mod_ll rhs)
	{
		m_v=(m_v-rhs.m_v+m_m)%m_m;
		return *this;
	}
	mod_ll operator - (mod_ll rhs)
	{
		auto ret=*this;
		return ret-=rhs;
	}
	mod_ll operator *= (ll rhs)
	{
		m_v=(m_v*rhs)%m_m;
		return *this;
	}
	mod_ll operator *= (mod_ll rhs)
	{
		m_v=(m_v*rhs.m_v)%m_m;
		return *this;
	}
	mod_ll operator * (mod_ll rhs)
	{
		mod_ll ret=*this;
		return ret*=rhs;
	}
	mod_ll operator ^ (ll rhs)
	{
		mod_ll t=*this;
		mod_ll ret(1LL);

		for(;rhs>0;rhs>>=1)
		{
			if(rhs&1) ret*=t;
			t*=t;
		}
		return ret;
	}
	mod_ll operator /= (mod_ll rhs)
	{
		return *this*=(rhs^(m_m-2));
	}
	mod_ll operator /= (ll rhs)
	{
		mod_ll t(rhs);
		return *this/=t;
	}
	mod_ll operator / (mod_ll rhs)
	{
		mod_ll ret=*this;
		return ret/=rhs;
	}
};


mod_ll mod_fact(int n)
{
	static vector<mod_ll> memo(1);

	if((int)memo.size()<=n)
	{
		if(memo.size()==1)
		{
			memo[0]=1;
		}
		for(int i=memo.size();i<=n;i++)
		{
			memo.push_back(memo.back()*i);
		}
	}
	return memo[n];
}


mod_ll mod_nCr(int n, int r)
{
	mod_ll bunsi=mod_fact(n);
	mod_ll bunbo=mod_fact(n-r)*mod_fact(r);
	return bunsi/bunbo;
}


mod_ll mod_nCr2(int n, int r)
{
	mod_ll bunsi(1);
	mod_ll bunbo(1);
	if(r*2>n) r=n-r;

	for(int i=0;i<r;i++)
	{
		bunsi*=(n-i);
		bunbo*=(i+1);
	}

	return bunsi/bunbo;
}


mod_ll mod_nPr(int n, int r)
{
	mod_ll ret(1);

	for(int i=0;i<r;i++)
	{
		ret*=(n-i);
	}
	return ret;
}


struct u_t
{
	mod_ll m_v;
	int m_y;
	u_t(int y) : m_y(y) {m_v=1;}
};


template<typename X>
bool max_u(X&m, X v)
{
	if(m<v)
	{
		m=v;
		return true;
	}
	return false;
}


template<typename X>
bool min_u(X&m, X v)
{
	if(m>v)
	{
		m=v;
		return true;
	}
	return false;
}

int main(void)
{
	int n;
	while(scanf("%d", &n)==1)
	{
		vector<pii> xy(n);
		int x_min= 1000000001;
		int y_max=-1000000001;
		for(int i=0;i<n;i++)
		{
			int x, d;
			scanf("%d%d", &x, &d);
			xy[i]=make_pair(x, x+d);
			min_u(x_min, x);
			max_u(y_max, x+d);
		}
		xy.push_back(make_pair(x_min-1, y_max+1));
		sort(xy.begin(), xy.end());

		deque<u_t> q;
		q.push_back(u_t(y_max));
		for(int i=1;i<=n;i++)
		{
			int x=xy[i].first;
			int y=xy[i].second;
			while(q.back().m_y<=x)
			{
				auto u=q.back();
				q.pop_back();
				q.back().m_v*=(u.m_v+1);
			}
			max_u(q.back().m_y, y);
			q.push_back(u_t(y));
//			printf("q.size()=%d  x=%d y=%d m_v=%lld\n", q.size(), x, y, q.back().m_v());
		}
		u_t ans(1);
		while(!q.empty())
		{
			ans=q.back();
			q.pop_back();
			if(q.empty()) break;
			q.back().m_v*=(ans.m_v+1);
		}
		printf("%lld\n", ans.m_v());
	}
	return 0;
}


Measured memory_bytes: 6500