func readInt() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
 
func main() {
    let _ = Int(readLine()!)!
    var A = readInt()
 
    var a = A[0]
    var W = A[1]
    var B = A[2]
    var V = A[3]
    var C = A[4]
    var answer = true
    if V >= W{
        answer = false
    }
    var temp = (W - V) * 3
    if (B - a) >= temp{
        answer = false
    }
    print(answer)
}
main()