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