def parse(inFile):
n = inFile.getInt()
vines = [inFile.getInts() for k in xrange(n)]
dist = inFile.getInt()
return (n, vines, dist)
def solve((n, vines, dist)):
best = [-1] * n
best[0] = 0
j = 1
for i in xrange(n):
if best[i] != -1:
reach = vines[i][0] + min(vines[i][1], vines[i][0] - best[i])
if reach >= dist:
return "YES"
while (j < n) and (vines[j][0] <= reach):
best[j] = vines[i][0]
j += 1
return "NO"
if __name__ == "__main__":
from GCJ import GCJ
GCJ(parse, solve, "/Users/lpebody/gcj/2012_2/a/", "A").run()
ZGVmIHBhcnNlKGluRmlsZSk6CiAgICBuID0gaW5GaWxlLmdldEludCgpCiAgICB2aW5lcyA9IFtpbkZpbGUuZ2V0SW50cygpIGZvciBrIGluIHhyYW5nZShuKV0KICAgIGRpc3QgPSBpbkZpbGUuZ2V0SW50KCkKICAgIHJldHVybiAobiwgdmluZXMsIGRpc3QpCgpkZWYgc29sdmUoKG4sIHZpbmVzLCBkaXN0KSk6CiAgICBiZXN0ID0gWy0xXSAqIG4KICAgIGJlc3RbMF0gPSAwCiAgICBqID0gMQogICAgZm9yIGkgaW4geHJhbmdlKG4pOgogICAgICAgIGlmIGJlc3RbaV0gIT0gLTE6CiAgICAgICAgICAgIHJlYWNoID0gdmluZXNbaV1bMF0gKyBtaW4odmluZXNbaV1bMV0sIHZpbmVzW2ldWzBdIC0gYmVzdFtpXSkKICAgICAgICAgICAgaWYgcmVhY2ggPj0gZGlzdDoKICAgICAgICAgICAgICAgIHJldHVybiAiWUVTIgogICAgICAgICAgICB3aGlsZSAoaiA8IG4pIGFuZCAodmluZXNbal1bMF0gPD0gcmVhY2gpOgogICAgICAgICAgICAgICAgYmVzdFtqXSA9IHZpbmVzW2ldWzBdCiAgICAgICAgICAgICAgICBqICs9IDEKICAgIHJldHVybiAiTk8iCgppZiBfX25hbWVfXyA9PSAiX19tYWluX18iOgogICAgZnJvbSBHQ0ogaW1wb3J0IEdDSgogICAgR0NKKHBhcnNlLCBzb2x2ZSwgIi9Vc2Vycy9scGVib2R5L2djai8yMDEyXzIvYS8iLCAiQSIpLnJ1bigpCgogICAgICAgICAgICAK