#include using namespace std; int main(){ int N, A, H, M, S; cin >> N >> A >> H >> M >> S; H += N * A / 3600; M += (N * A % 3600) / 60; S += N * A % 60; if (H * 3600 + M * 60 + S >= 86400) cout << "Yes" << endl; else cout << "No" << endl; }