#include<bits/stdc++.h>
using namespace std;
#define int long long
#define mid ((l + r) >> 1)
#define ls (now << 1)
#define rs ((now << 1) | 1)
#define mp make_pair

const int N = 100005;
const int inf = 2e17 + 1;
int S;
int n, s = 1, pr[N], tp;
void init()
{
	cin >> n; int nn = n;
	pr[0] = 1;
	for(int i = 1; i <= 9; ++ i)
		s *= i, pr[++ tp] = s;
	while(n)
	{
		S += pr[n % 10];
		n /= 10;
	}
	cout << S << endl;
	puts(S == nn ? "yes" : "no");
}
signed main()
{
	int T = 1;
//	cin >> T;
	while(T --)
		init();
	return 0;
}


