#include<bits/stdc++.h>
using namespace std;
int m, s, t, x, y, h;
int main() {
cin >> m >> s >> t;
h = t;
while(t --) {
y += 17;
if(m >= 10) {
m -= 10;
x += 60;
}
if(y < x) y = x;
if(y >= s) {
cout << "Yes\n" << h - t;
return 0;
}
}
cout << "No\n" << y;
return 0;
}