#include using namespace std; typedef long long ll; typedef string str; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll n, a, h, m, s; cin >> n >> a >> h >> m >> s; ll sum = h * 3600 + m * 60 + s + n * a; if (sum < 24 * 3600) cout << "No\n"; else cout << "Yes\n"; return 0; }