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

int main()
{
	int n, sum = 0;
	cin >> n;
	int nn = n;
	while(n != 0)
	{
		int s = n % 10, a = 1;
		for(int i = 1; i <= s; ++ i)
			a *= i;
		sum += a;
		n /= 10; 
	}
	cout << sum << endl;
	if(nn == sum) cout << "yes";
	else cout << "no";
	return 0;
}
