#include <bits/stdc++.h>
#define rep(a,n) for (ll a = 0; a < (n); ++a)
using namespace std;
using ll = long long;
typedef pair<ll,ll> P;
typedef pair<P,ll> PP;
typedef vector<vector<ll> > Graph;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF = 1e18;


struct SegmentTreeBeats {
    static const long long INF = 1LL << 60;
    struct Node {
        Node *left, *right;
        long long max_v, secmax_v, max_c;
        long long min_v, secmin_v, min_c;
        long long sum;
        long long len, l_add, l_val;

        Node() : left(0), right(0), l_add(0), l_val(INF) {}

        void init(long long x) {
            max_v = min_v = sum = x;
            secmax_v = -INF; secmin_v = INF;
            max_c = min_c = 1;
        }

        void init_empty() {
            max_v = secmax_v = -INF;
            min_v = secmin_v = INF;
            max_c = min_c = 0;
        }

        void update_max(long long x) {
            sum += (x - max_v) * max_c;
            if (max_v ==  min_v) max_v =  min_v = x;
            else if (max_v == secmin_v) max_v = secmin_v = x;
            else                      max_v = x;
            if (l_val != INF and x < l_val) l_val = x;
        }

        void update_min(long long x) {
            sum += (x - min_v) * min_c;
            if (max_v ==  min_v) max_v =  min_v = x;
            else if (max_v == secmin_v) min_v = secmax_v = x;
            else                      min_v = x;
            if (l_val != INF and l_val < x) l_val = x;
        }

        void addall(long long x) {
            max_v += x;
            if (secmax_v != -INF) secmax_v += x;
            min_v += x;
            if (secmin_v != INF) secmin_v += x;
            sum += len * x;
            if (l_val != INF) l_val += x;
            else             l_add += x;
        }

        void updateall(long long x) {
            max_v = min_v = x;
            secmax_v = -INF; secmin_v = INF;
            max_c = min_c = len;
            sum = len * x;
            l_val = x; l_add = 0;
        }

        void push() {
            if (l_val != INF) {
                 left -> updateall(l_val);
                right -> updateall(l_val);
                l_val = INF;
                return;
            }
            if (l_add != 0) {
                 left -> addall(l_add);
                right -> addall(l_add);
                l_add = 0;
            }
            if (max_v < left -> max_v)   left -> update_max(max_v);
            if (left -> min_v < min_v)   left -> update_min(min_v);
            if (max_v < right -> max_v) right -> update_max(max_v);
            if (right -> min_v < min_v) right -> update_min(min_v);
        }

        void update() {
            sum = left -> sum + right -> sum;
            if (left -> max_v < right -> max_v) {
                max_v = right -> max_v;
                max_c = right -> max_c;
                secmax_v = max(left -> max_v, right -> secmax_v);
            } else if (left -> max_v > right -> max_v) {
                max_v = left -> max_v;
                max_c = left -> max_c;
                secmax_v = max(left -> secmax_v, right -> max_v);
            } else {
                max_v = left -> max_v;
                max_c = left -> max_c + right -> max_c;
                secmax_v = max(left -> secmax_v, right -> secmax_v);
            }
            if (left -> min_v < right -> min_v) {
                min_v = left -> min_v;
                min_c = left -> min_c;
                secmin_v = min(left -> secmin_v, right -> min_v);
            } else if (left -> min_v > right -> min_v) {
                min_v = right -> min_v;
                min_c = right -> min_c;
                secmin_v = min(left -> min_v, right -> secmin_v);
            } else {
                min_v = left -> min_v;
                min_c = left -> min_c + right -> min_c;
                secmin_v = min(left -> secmin_v, right -> secmin_v);
            }
        }
    };

    int n, n0;
    Node *root;

    void sub_update_min(long long x, int a, int b, Node *nd, int l, int r) {
        if (b <= l || r <= a || nd -> max_v <= x) return;
        if (a <= l && r <= b && nd -> secmax_v < x) {
            nd -> update_max(x);
            return;
        }
        nd -> push();
        sub_update_min(x, a, b, nd ->  left, l, (l + r) >> 1);
        sub_update_min(x, a, b, nd -> right, (l + r) >> 1, r);
        nd -> update();
    }

    void sub_update_max(long long x, int a, int b, Node *nd, int l, int r) {
        if (b <= l || r <= a || x <= nd -> min_v) return;
        if (a <= l && r <= b && x < nd -> secmin_v) {
            nd -> update_min(x);
            return;
        }
        nd -> push();
        sub_update_max(x, a, b, nd ->  left, l, (l + r) >> 1);
        sub_update_max(x, a, b, nd -> right, (l + r) >> 1, r);
        nd -> update();
    }

    void sub_add_val(long long x, int a, int b, Node *nd, int l, int r) {
        if (b <= l || r <= a) return;
        if (a <= l && r <= b) {
            nd -> addall(x);
            return;
        }
        nd -> push();
        sub_add_val(x, a, b, nd ->  left, l, (l + r) >> 1);
        sub_add_val(x, a, b, nd -> right, (l + r) >> 1, r);
        nd -> update();
    }

    void sub_update_val(long long x, int a, int b, Node *nd, int l, int r) {
        if (b <= l || r <= a) return;
        if (a <= l && r <= b) {
            nd -> updateall(x);
            return;
        }
        nd -> push();
        sub_update_val(x, a, b, nd ->  left, l, (l + r) >> 1);
        sub_update_val(x, a, b, nd -> right, (l + r) >> 1, r);
        nd -> update();
    }

    long long sub_query_max(int a, int b, Node *nd, int l, int r) {
        if (b <= l || r <= a) return -INF;
        if (a <= l && r <= b) return nd -> max_v;
        nd -> push();
        long long lv = sub_query_max(a, b, nd ->  left, l, (l + r) >> 1);
        long long rv = sub_query_max(a, b, nd -> right, (l + r) >> 1, r);
        return max(lv, rv);
    }

    long long sub_query_min(int a, int b, Node *nd, int l, int r) {
        if (b <= l || r <= a) return INF;
        if (a <= l && r <= b) return nd -> min_v;
        nd -> push();
        long long lv = sub_query_min(a, b, nd ->  left, l, (l + r) >> 1);
        long long rv = sub_query_min(a, b, nd -> right, (l + r) >> 1, r);
        return min(lv, rv);
    }

    long long sub_query_sum(int a, int b, Node *nd, int l, int r) {
        if (b <= l || r <= a) return 0;
        if (a <= l && r <= b) return nd -> sum;
        nd -> push();
        long long lv = sub_query_sum(a, b, nd ->  left, l, (l + r) >> 1);
        long long rv = sub_query_sum(a, b, nd -> right, (l + r) >> 1, r);
        return lv + rv;
    }

    SegmentTreeBeats(int n, long long val = 0) : n(n) {
        n0 = 1; while (n0 < n) n0 <<= 1;
        Node *nds = new Node[2 * n0];
        root = nds;
        nds[0].len = n0;
        for (int i = 0; i < n0 - 1; ++i) {
            nds[i].left = &nds[2 * i + 1];
            nds[i].right = &nds[2 * i + 2];
            nds[2 * i + 1].len = nds[2 * i + 2].len = nds[i].len >> 1;
        }
        for (int i = 0; i <  n; ++i) nds[n0 - 1 + i].init(val);
        for (int i = n; i < n0; ++i) nds[n0 - 1 + i].init_empty();
        for (int i = n0 - 2; i >= 0; i--) nds[i].update();
    }

    SegmentTreeBeats(vector<long long> a) : n(a.size()) {
        n0 = 1; while (n0 < n) n0 <<= 1;
        Node *nds = new Node[2 * n0];
        root = nds;
        nds[0].len = n0;
        for (int i = 0; i < n0 - 1; ++i) {
            nds[i].left = &nds[2 * i + 1];
            nds[i].right = &nds[2 * i + 2];
            nds[2 * i + 1].len = nds[2 * i + 2].len = nds[i].len >> 1;
        }
        for (int i = 0; i <  n; ++i) nds[n0 - 1 + i].init(a[i]);
        for (int i = n; i < n0; ++i) nds[n0 - 1 + i].init_empty();
        for (int i = n0 - 2; i >= 0; i--) nds[i].update();
    }

    void update_min(int a, int b, long long x) { sub_update_min(x, a, b, root, 0, n0); }
    void update_max(int a, int b, long long x) { sub_update_max(x, a, b, root, 0, n0); }
    void add_val(int a, int b, long long x)    { sub_add_val(x, a, b, root, 0, n0); }
    void update_val(int a, int b, long long x) { sub_update_val(x, a, b, root, 0, n0); }
    long long query_max(int a, int b) { return sub_query_max(a, b, root, 0, n0); }
    long long query_min(int a, int b) { return sub_query_min(a, b, root, 0, n0); }
    long long query_sum(int a, int b) { return sub_query_sum(a, b, root, 0, n0); }
};


//const int mod = 1000000007;
const int mod = 998244353;
struct mint {
  ll x; // typedef long long ll;
  mint(ll 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 { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= 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 { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

//入力
ll n;
vector<P>robot;

vector<ll>after_move;//移動後の座標

mint dp[200010];

int main(){
    cin >> n;
    robot.resize(n);
    after_move.resize(n);
    rep(i,n){
        ll x,d;
        cin >> x >> d;
        robot[i]=P(x,d);
    }
    sort(robot.begin(),robot.end());
    vector<ll>x(n);
    vector<ll>d(n);
    rep(i,n){
        x[i]=robot[i].first;
        d[i]=robot[i].second;
        after_move[i]=x[i]+d[i];
    }
    SegmentTreeBeats seg(n);
    for(int i=n-1;i>=0;i--){
        ll aft = after_move[i];
        ll idx = lower_bound(x.begin(),x.end(),aft)-x.begin();
        idx--;
        seg.update_val(i,i+1,idx);
        ll M = seg.query_max(i,idx+1);
        seg.update_val(i,i+1,M);
    }
    dp[n]=1;
    for(int i=n-1;i>=0;i--){
        dp[i]+=dp[i+1];
        ll now = seg.query_sum(i,i+1);
        dp[i]+=dp[now+1];
    }
    cout << dp[0] << endl;
    return 0;
}

Measured memory_bytes: 61892