/**

   * Made by:    Diego Briaares
   * At:   06.03.2021 16:16:56
**/

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


void optimize() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
}

	int main () {
		optimize();
		int n;
		cin >> n;
		vector<pair<int, int>> emp(n);
		int ans = 1e9;
		for (int i = 0; i < n; i++)	{
			cin >> emp[i].first >> emp[i].second;
			ans = min(ans, emp[i].first + emp[i].second);
		}
		for (int i = 0; i < n; i++) {
			for (int j = i + 1; j < n; j++) {
				ans = min(ans, max(emp[i].first, emp[j].second));
				ans = min(ans, max(emp[j].first, emp[i].second));
			}
		}
		cout << ans << "\n";
	}
#include <cmath>
#include <deque>
#include <algorithm>
#include <iterator>
#include <list>
#include <tuple>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <unordered_set>
#include <stack>
#include <string>
#include <vector>
#include <fstream>
#include <iostream>
#include <functional>
#include <numeric>
#include <iomanip> 
#include <stdio.h>
//end of libraries
#define lnf 3999999999999999999
#define inf 999999999
#define PI 3.14159265359
#define endl "\n"
#define fi first
#define se second
#define pb push_back
#define ll long long
#define all(c) (c).begin(),(c).end()
#define sz(c) (int)(c).size()
#define mkp(a,b) make_pair(a,b)
#define make_unique(a) sort(all(a)),a.erase(unique(all(a)),a.end())
#define rsz(a,n) a.resize(n)
#define pii pair <int,int>
#define rep(i,n) for(int i = 0 ; i < n ; i++) 
#define drep(i,n) for(int i = n-1 ; i >= 0 ; i--)
#define crep(i,x,n) for(int i = x ; i < n ; i++)
#define fcin ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);

const int max_n = 300000;

using namespace std;
int n,m;
ll mod = 998244353 , fact[max_n];
ll binpow(ll a, ll b) {  
  a %= mod; ll res = 1; 
  while (b) { if (b%2) res = res * a % mod; a = a * a % mod; b /= 2; } 
  return res % mod;
}
void dofact() {
  fact[0]=fact[1]=1;
  rep(i,max_n-3){
    if(i>1)fact[i] = fact[i-1]*i; fact[i] %= mod;
  }
}

ll cnk(ll k , ll n){
  if(k>n) return 0;
  return (fact[n] * binpow(fact[k]*fact[n-k]%mod,mod-2)) % mod;
}
ll sub(ll a , ll b){
  a%=mod; b%=mod;
  return (((a-b)%mod)+mod)%mod;
}
ll prod(ll a , ll b){
  a%=mod; b%=mod;
  return ((a*b)%mod);
}

ll add(ll a , ll b){
  a%=mod; b%=mod;
  return (a+b)%mod;
}

int main(){
fcin;
dofact();

	cin >> n >> m;
	vector <pii> b;
	
	ll ans = 0;

	for(int i = 1 ; i <= m ; i++) {
		int y = i;
		b.clear();
		for(int x = 2 ; x <= sqrt(i) ; x++) {
			if(y%x == 0) {
				int cnt = 0;
				while(y%x == 0) {y/=x; cnt++;}
				b.pb({x,cnt});
			}
		}

		b.pb({y,1});
		
		ll c = 1;
		for(auto p : b) {
			if(p.fi == 1) continue;
			// cout << cnk(p.se,n+p.se-1) << " , ";
			// c *= cnk(p.se,n+p.se-1);
			c = prod(c,cnk(p.se,n+p.se-1));
		}
		// ans += c;
		ans = add(ans,c);
		// cout << c << "\n";
	}

	cout << ans << "\n";

/*
*/

    return 0;   
}
