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