#include using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); int n, a, h, m, s; cin >> n >> a >> h >> m >> s; cout << (h * 3600 + m * 60 + s + a * n >= 86400 ? "Yes" : "No") << '\n'; return 0; }