Answers
from datetime import date
'''Aug 23 2014
Jul 1 2014
60'''
def Month_As_Int(month):
if(month=="Jan"):
return 1
elif(month=="Feb"):
return 2
elif (month == "Mar"):
return 3
elif (month == "Apr"):
return 4
elif (month == "May"):
return 5
elif (month == "Jun"):
return 6
elif (month == "Jul"):
return 7
elif (month == "Aug"):
return 8
elif (month == "Sep"):
return 9
elif (month == "Oct"):
return 10
elif (month == "Nov"):
return 11
elif (month == "Dec"):
return 12
expiry_date=input()
departure_date=input()
number_of_days=int(input())
exp_date=date(int(expiry_date.split(" ")[2]),Month_As_Int(expiry_date.split(" ")[0]),int(expiry_date.split(" ")[1]))
dept_date=date(int(departure_date.split(" ")[2]),Month_As_Int(departure_date.split(" ")[0]),int(departure_date.split(" ")[1]))
diff_of_day=(exp_date-dept_date).days
if(number_of_days>diff_of_day):
print("No")
elif(number_of_days<diff_of_day):
print("Yes")