using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace AtCorder
{
	public class Program
	{
		static void Main(string[] args)
		{
			var cin = new Scanner2();
			int n = cin.Int();
			var xdt = new Tuple<long, long>[n];
			for (int i = 0; i < n; i++) {
				long x = cin.Long();
				long d = cin.Long();
				xdt[i] = new Tuple<long, long>(x, d);
			}

			var xd = xdt.OrderBy(x => x.Item1).ToArray();

			var reach = new SegmentTree<int>(n, 0, (x, y) => Math.Max(x, y));
			for (int i = n - 1; i >= 0; i--) {
				if (i == n - 1) {
					reach[i] = i;
				} else {
					long dd = xd[i].Item1 + xd[i].Item2;

					int ok = i;
					int ng = n;
					while (ng - ok > 1) {
						int mid = (ok + ng) / 2;
						if (xd[mid].Item1 < dd) {
							ok = mid;
						} else {
							ng = mid;
						}
					}

					if (ok == i) {
						reach[i] = i;
					} else if (i + 1 == ok) {
						reach[i] = reach[ok];
					} else {
						reach[i] = reach.Query(i + 1, ok + 1);
					}
				}
			}
			
			ModInt.P = 998244353;
			var dp = new ModInt[n + 1];
			dp[0] = 1;

			for (int i = 0; i < n; i++) {
				if (reach[i] == i) {
					dp[i + 1] += dp[i] * 2;
				} else {
					dp[i + 1] += dp[i];
					dp[reach[i] + 1] += dp[i];
				}
			}

			ModInt ans = dp[n];
			Console.WriteLine(ans.Value);
		}

		class Range
		{
			public int Count { get; set; }
			public long Max { get; set; }
		}
	}

	public class SegmentTree<T>
	{
		private readonly int n_;
		private readonly T unit_;
		private readonly T[] tree_;
		private readonly Func<T, T, T> merge_;

		public int Count { get; }
		public T Top => tree_[1];

		public SegmentTree(int count, T unit, Func<T, T, T> merge)
		{
			merge_ = merge;
			unit_ = unit;

			Count = count;
			n_ = 1;
			while (n_ < count) {
				n_ <<= 1;
			}

			tree_ = new T[n_ << 1];
			for (int i = 0; i < tree_.Length; i++) {
				tree_[i] = unit;
			}
		}

		public SegmentTree(T[] src, T max, Func<T, T, T> merge)
			: this(src.Length, max, merge)
		{
			for (int i = 0; i < n_; ++i) {
				tree_[i + n_] = src[i];
			}

			for (int i = n_ - 1; i > 0; --i) {
				tree_[i] = merge_(tree_[i << 1], tree_[(i << 1) + 1]);
			}
		}

		public T this[int index]
		{
			get { return tree_[index + n_]; }
			set { Update(index, value); }
		}

		public void Update(int index, T val)
		{
			if (index >= Count) {
				return;
			}

			index += n_;
			tree_[index] = val;
			index >>= 1;
			while (index != 0) {
				tree_[index] = merge_(tree_[index << 1], tree_[(index << 1) + 1]);
				index >>= 1;
			}
		}

		public T Query(int left, int right)
		{
			if (left > right || right < 0 || left >= Count) {
				return unit_;
			}

			int l = left + n_;
			int r = right + n_;
			T valL = unit_;
			T valR = unit_;
			while (l < r) {
				if ((l & 1) != 0) {
					valL = merge_(valL, tree_[l]);
					++l;
				}
				if ((r & 1) != 0) {
					--r;
					valR = merge_(tree_[r], valR);
				}

				l >>= 1;
				r >>= 1;
			}

			return merge_(valL, valR);
		}
	}

	public struct ModInt
	{
		public static long P { get; set; } = (long)1e9 + 7;

		public static ModInt Pow(ModInt value, long k)
		{
			return Pow(value.Value, k);
		}

		public static ModInt Pow(long value, long k)
		{
			long ret = 1;
			for (k %= P - 1; k > 0; k >>= 1, value = value * value % P) {
				if ((k & 1) == 1) {
					ret = ret * value % P;
				}
			}
			return new ModInt(ret);
		}

		public static ModInt Inverse(ModInt value)
		{
			return Pow(value, P - 2);
		}

		public long Value;

		public ModInt(long value)
		{
			value %= P;
			if (value < 0) {
				value += P;
			}

			Value = value;
		}

		public static ModInt operator +(ModInt lhs, ModInt rhs)
		{
			lhs.Value += rhs.Value;
			if (lhs.Value >= P) {
				lhs.Value -= P;
			}
			return lhs;
		}

		public static ModInt operator -(ModInt lhs, ModInt rhs)
		{
			lhs.Value -= rhs.Value;
			if (lhs.Value < 0) {
				lhs.Value += P;
			}

			return lhs;
		}

		public static ModInt operator *(ModInt lhs, ModInt rhs)
		{
			return new ModInt(lhs.Value * rhs.Value % P);
		}
		public static ModInt operator /(ModInt lhs, ModInt rhs)
		{
			long exp = P - 2;
			while (exp > 0) {
				if (exp % 2 > 0) {
					lhs *= rhs;
				}

				rhs *= rhs;
				exp /= 2;
			}

			return lhs;
		}

		public static implicit operator ModInt(long n)
		{
			n %= P;
			if (n < 0) {
				n += P;
			}

			return new ModInt(n);
		}

		public override string ToString()
		{
			return Value.ToString();
		}
	}

	public class Scanner2
	{
		private readonly char[] delimiter_ = new char[] { ' ' };
		private readonly string filePath_;
		private readonly Func<string> reader_;
		private string[] buf_;
		private int index_;

		public Scanner2(string file = "")
		{
			if (string.IsNullOrWhiteSpace(file)) {
				reader_ = Console.ReadLine;
			} else {
				filePath_ = file;
				var fs = new StreamReader(file);
				reader_ = fs.ReadLine;
			}
			buf_ = new string[0];
			index_ = 0;
		}

		public string Next()
		{
			if (index_ < buf_.Length) {
				return buf_[index_++];
			}

			string st = reader_();
			while (st == "") {
				st = reader_();
			}

			buf_ = st.Split(delimiter_, StringSplitOptions.RemoveEmptyEntries);
			if (buf_.Length == 0) {
				return Next();
			}

			index_ = 0;
			return buf_[index_++];
		}

		public int Int() => int.Parse(Next());
		public long Long() => long.Parse(Next());
		public double Double() => double.Parse(Next());

		public int[] ArrayInt(int N, int add = 0)
		{
			int[] Array = new int[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Int() + add;
			}
			return Array;
		}

		public long[] ArrayLong(int N, long add = 0)
		{
			long[] Array = new long[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Long() + add;
			}
			return Array;
		}

		public double[] ArrayDouble(int N, double add = 0)
		{
			double[] Array = new double[N];
			for (int i = 0; i < N; i++) {
				Array[i] = Double() + add;
			}
			return Array;
		}

		public void Save(string text)
		{
			if (string.IsNullOrWhiteSpace(filePath_)) {
				return;
			}

			File.WriteAllText(filePath_ + "_output.txt", text);
		}
	}
}

Measured memory_bytes: 34536