#include <bits/stdc++.h>
#define PI 3.14159265359
#define lp(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
typedef long double ld;

using namespace std;

int sum(const string &a) {
    int ret = 0;
    for (int i = 0; i < 3; i++) {
        ret += a[i] - '0';
    }
    return ret;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    string a, b;
    cin >> a >> b;
    cout << max(sum(a), sum(b)) << endl;
    return 0;
}

#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
#define code                     \
	ios::sync_with_stdio(false); \
	cin.tie(0);                  \
	cout.tie(0);
#define int long long
#define endl '\n'
#define MM(a, b) memset(a, b, sizeof(a))
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
// using namespace __gnu_pbds;
// typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char *name, Arg1 &&arg1)
{
	cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args &&... args)
{
	const char *comma = strchr(names + 1, ',');
	cout.write(names, comma - names) << " : " << arg1 << " | ";
	__f(comma + 1, args...);
}

bool isSq(int x){
	if(x<0) return 0;
	int y = sqrt(x);
	return y*y == x;
}

int32_t main()
{
	code;
	int s,p; cin>>s>>p;
	bool yes =0;
	for(int i=0;i<=sqrt(p);i++){
		if(i*(s-i)==p) {
			yes = 1;
			break;
		}
	}
	if(yes) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}
