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

#define int long long
#define ALL(x) x.begin(),x.end()
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
#define pb(x) push_back(x)
#define eb emplace_back
#define SORT(ls) sort(ls.begin(), ls.end())
#define DESC(ls) sort(ls.rbegin(), ls.rend()) 
#define mp(x, y) make_pair(x, y)
#define INF 1000000000
#define MOD 998244353
#define F(i, a, n) for(i=a;i<n;i++)
#define B(i, a, n) for(i=n-1;i>=0;i--)
#define SI(x) cin>>x
#define DI(x, y) cin>>x>>y
#define TI(x, y, z) cin>>x>>y>>z
#define FI(w, x, y, z) cin>>w>>x>>y>>z
#define SO(x) cout<<x<<"\n"
#define DO(x, y) cout<<x<<" "<<y<<"\n"
#define TO(x, y, z) cout<<x<<" "<<y<<" "<<z<< "\n"
#define FO(w, x, y, z) cout<<w<<" "<<x<<" "<<y<<" "<<z<<"\n"
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

struct SegmentTreeNode 
{
    int res;
    
    void assignLeaf(int value) 
    {
        res = value;
    }
  
    void merge(SegmentTreeNode& left, SegmentTreeNode& right) 
    {
        res = max(left.res, right.res);
    }

    int getValue() 
    {
        return res;
    }
};



template<class T, class V>
class SegmentTree
{
    SegmentTreeNode *nodes;
    int N;

public:
    SegmentTree(T arr[], int N)
    {
        this->N = N;
        nodes = new SegmentTreeNode[getSize(N)];
        buildTree(arr, 1, 0, N - 1);
    }

    ~SegmentTree()
    {
        delete []nodes;
    }

    V getValue(int lo, int hi)
    {
        SegmentTreeNode result = getValue(1, 0, N - 1, lo, hi);
        return result.getValue();
    }

    void update(int index, T val)
    {
        update(1, 0, N - 1, index, val);
    }


private:

    void buildTree(T arr[], int stIndex, int lo, int hi)
    {
        if(lo == hi)
        {
            nodes[stIndex].assignLeaf(arr[lo]);
            return;
        }
        int mid = (lo + hi) / 2;
        buildTree(arr, 2*stIndex, lo, mid);
        buildTree(arr, 2*stIndex + 1, mid + 1, hi);
        nodes[stIndex].merge(nodes[2*stIndex], nodes[2*stIndex + 1]);
    }
    
    SegmentTreeNode getValue(int stIndex, int left, int right, int lo, int hi)
    {
        if(left == lo && right == hi)
            return nodes[stIndex];
        int mid = (left + right) / 2;
        if(lo > mid)
            return getValue(2*stIndex + 1, mid + 1, right, lo, hi);
        if(hi <= mid)
            return getValue(2*stIndex, left, mid, lo, hi);
        SegmentTreeNode leftResult = getValue(2*stIndex, left, mid, lo, mid);
        SegmentTreeNode rightResult = getValue(2*stIndex + 1, mid + 1, right, mid + 1, hi);
        SegmentTreeNode result;
        result.merge(leftResult, rightResult);
        return result;
    }


    void update(int stIndex, int lo, int hi, int index, T value)
    {
        if(lo == hi)
        {
            nodes[stIndex].assignLeaf(value);
            return;
        }
        int mid = (lo + hi) / 2;
        if(index <= mid)
            update(2*stIndex, lo, mid, index, value);
        else
            update(2*stIndex + 1, mid + 1, hi, index, value);
        nodes[stIndex].merge(nodes[2*stIndex], nodes[2*stIndex + 1]);
    }


    int getSize(int n)
    {
		int size = 1;
		for (; size < N; size <<= 1);
		return size << 1;
    }
};

inline int add(int a, int b) { return a + b >= MOD ? a + b - MOD : a + b; }
inline void inc(int& a, int b) { a = add(a, b); }
inline int sub(int a, int b) { return a - b < 0 ? a - b + MOD : a - b; }
inline void dec(int& a, int b) { a = sub(a, b); }


int32_t main(void)
{
    FASTER;
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    int i, j;
    int n;
    SI(n);
    vii a(n);
    F(i, 0, n)
        DI(a[i].first, a[i].second);
    sort(a.begin(), a.end());
    int last[n];
    F(i, 0, n)
        last[i] = i;
    SegmentTree<int, int> st(last, n);
    for(i = n - 2; i >= 0; i--)
    {
        int y = lower_bound(a.begin(), a.end(), mp(a[i].first + a[i].second, LONG_LONG_MIN)) - a.begin();
        if(y == n || a[y].first >= a[i].first + a[i].second)
            y--;
        last[i] = st.getValue(i, y);
        st.update(i, last[i]);
    }
    int dp[n][2];
    memset(dp, 0, sizeof(dp));
    dp[n - 1][0] = dp[n - 1][1] = 1;
    for(int i = n - 2; i >= 0; i--)
    {
        inc(dp[i][0], add(dp[i + 1][0], dp[i + 1][1]));
        if(last[i] == n - 1)
            dp[i][1] = 1;
        else
        {
            int x = last[i] + 1;
            inc(dp[i][1], add(dp[x][0], dp[x][1]));
        }
    }
    SO(add(dp[0][0], dp[0][1]));
    return 0;
}

Measured memory_bytes: 12160