using System;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using static System.Math;
using System.Numerics;
static class Program{
	const int mod=(int)1e9+7;
	static void Main(){
		Sc sc=new Sc();
		var n=sc.I;
		var h=new int[n][];
		var c=new int[n+1];
		var a=new int[n];
		var dp1=new Mint[n+1];
		var dp2=new Mint[n+1];
		St st=new St(n+1,true,false,0); 
		c[n]=n;
		st.Ud(n,n);
		dp2[n]=1;
		for(int i = 0;i<n;i++) {
			h[i]=sc.Ia;
			a[i]=h[i][0];
		}
		Array.Sort(h,(u,v)=>u[0]-v[0]);
		Array.Sort(a);
		for(int i = n-1;i>=0;i--) {
			c[i]=a.Bs(h[i][0]+h[i][1],false)-1;
			st.Ud(i,i);
			st.Ud(i,(int)st.Get(i,c[i]).d);
			if(i==n-1){
				dp1[i]=1;
				dp2[i]=1;
			}
			else{
				dp1[i]=dp1[i+1]+dp2[i+1];
				var p=st.Get(i,i).d;
				if(p==i){
					dp2[i]=dp1[p+1]+dp2[p+1];
				}
				else{
					dp2[i]=dp1[p+1]+dp2[p+1];
				}
			}
		}
		Console.WriteLine("{0}",dp1[0]+dp2[0]);
	}
}
static class Ex1{
	public static int Bs(this int[] a,int x,bool b){return Bs2(a,x,b,a.Length);}
	public static int Bs(this int[] a,int x,bool b,int ub){return Bs2(a,x,b,ub+1);}
	private static int Bs2(int[] a,int x,bool b,int ub){
		int lb=-1,mid=0;
		while(ub-lb>1){
			mid=(ub+lb)/2;
			if(a[mid]>=x){ub=mid;}
			else{lb=mid;}
		}
		return b?lb:ub;
	}
}
public class St{
	public class Dt{
		public int n;
		public long d;
		public Dt(long d,int n){this.d=d;this.n=n;}
		public override string ToString()=>"n:"+n.ToString()+" d:"+d.ToString();
	}
	public Dt[] dat;
	private int m=1;
	private bool mm,ku;
	private Dt du;
	private Func<Dt,Dt,bool> compare;
	public St(int n,bool mm,bool ku,long df){
		this.mm=mm;this.ku=ku;
		if(mm){du=new Dt(long.MinValue,-1);compare=CoMax;}
		else{du=new Dt(long.MaxValue,-1);compare=CoMin;}
		while(m<n){m<<=1;}
		m--;
		dat=new Dt[m+n+1];
		dat[m+n]=du;
		for(int i=m+n-1;i>=m;i--){dat[i]=new Dt(df,i-m);}
		for(int i=m-1;i>=0;i--){dat[i]=(i<<1)+1<m+n?dat[(i<<1)+1]:du;}
	}
	private bool CoMax(Dt x,Dt y){return x.d>y.d;}
	private bool CoMin(Dt x,Dt y){return x.d<y.d;}
	public void Ud(int q,long b){
		q+=m;
		if(ku){b+=dat[q].d;}
		dat[q].d=du.d;
		dat[q]=new Dt(b,q-m);
		q=(q-1)>>1;
		while(q>=0){
			Dt o=compare(dat[2*q+1],dat[2*q+2])?dat[2*q+1]:dat[2*q+2];
			if(dat[q]==o){break;}
			dat[q]=o;
			q=(q-1)>>1;
		}
	}
	private Dt Fdg(int a,int b,int k,int l,int r){
		if(r<a||b<l){return du;}
		if(a<=l&&r<=b){return dat[k];}
		Dt p=Fdg(a,b,k*2+1,l,(l+r)>>1);
		Dt q=Fdg(a,b,k*2+2,(l+r+1)>>1,r);
		return compare(p,q)?p:q;
	}
	public Dt Get(int a,int b){return Fdg(a,b,0,0,m);}
}
public struct Mint{
	const int mod=998244353;
	private long d;
	public Mint(long d){this.d=d;}
	public static implicit operator Mint(long d){return new Mint(d%mod);}
	public static explicit operator long(Mint d){return d.d;}
	public override string ToString(){return d.ToString();}
	public static Mint operator+(Mint a,long b){a.d=(a.d+b)%mod;return a;}
	public static Mint operator+(Mint a,Mint b){a.d=(a.d+b.d)%mod;return a;}
	public static Mint operator-(Mint a,long b){a.d=(mod+a.d-b)%mod;return a;}
	public static Mint operator-(Mint a,Mint b){a.d=(mod+a.d-b.d)%mod;return a;}
	public static Mint operator*(Mint a,long b){a.d=(a.d*b)%mod;return a;}
	public static Mint operator*(Mint a,Mint b){a.d=(a.d*b.d)%mod;return a;}
	public static Mint operator/(Mint a,long b){a.d=(a.d*Mi(b))%mod;return a;}
	public static Mint operator/(Mint a,Mint b){a.d=(a.d*Mi(b.d))%mod;return a;}
	private static long Mi(long a){
		a=(a+mod)%mod;
		long b=mod,u=1,v=0;
		while(b>0){
			long t=a/b;
			a-=t*b;a^=b;b^=a;a^=b;
			u-=t*v;u^=v;v^=u;u^=v;
		}
		u%=mod;
		if(u<0){u+=mod;}
		return u%mod;
	}
}
public class Sc{
	public int I{get{return int.Parse(Console.ReadLine());}}
	public long L{get{return long.Parse(Console.ReadLine());}}
	public double D{get{return double.Parse(Console.ReadLine());}}
	public string S{get{return Console.ReadLine();}}
	public int[] Ia{get{return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
	public object[] Oa{get{return Console.ReadLine().Split();}}
	public int[] Ia2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),int.Parse);}}
	public int[] Ia3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),int.Parse);}
	public int[] Ia3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),int.Parse);}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public long[] La3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),long.Parse);}
	public long[] La3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),long.Parse);}
	public double[] Da2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),double.Parse);}}
	public double[] Da3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),double.Parse);}
	public double[] Da3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),double.Parse);}
	public T[] Arr<T>(int n,Func<T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f();}return a;}
	public T[] Arr<T>(int n,Func<int,T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i);}return a;}
	public T[] Arr<T>(int n,Func<string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(Console.ReadLine().Split());}return a;}
	public T[] Arr<T>(int n,Func<int,string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i,Console.ReadLine().Split());}return a;}
}

Measured memory_bytes: 49804