303748: CF724A. Checking the Calendar

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Checking the Calendar

题意翻译

**题目描述:** 您将得到一周中某两天的英文名。 请判断是否有可能在某个非闰年期间,某个月的第一天为给出的第一天,下个月的第一天为给出的第二天。这两个月应属于同一年。 本题中,我们将使用公历,即一年有12个月,每个月的天数分别为: _31,28,31,30,31,30,31,31,30,31,30,31_ 。 给出的日期名称将以小写英文单词给出,即为: _"monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"_ 。 **输入格式:** 两行。 每一行分别为一周中某一天的英文名,保证格式如题目描述中所示。 **输出格式:** 如果可能,请输出 _"YES"_ (不加引号),否则输出 _"NO"_ (不加引号)。

题目描述

You are given names of two days of the week. Please, determine whether it is possible that during some non-leap year the first day of some month was equal to the first day of the week you are given, while the first day of the next month was equal to the second day of the week you are given. Both months should belong to one year. In this problem, we consider the Gregorian calendar to be used. The number of months in this calendar is equal to 12. The number of days in months during any non-leap year is: $ 31 $ , $ 28 $ , $ 31 $ , $ 30 $ , $ 31 $ , $ 30 $ , $ 31 $ , $ 31 $ , $ 30 $ , $ 31 $ , $ 30 $ , $ 31 $ . Names of the days of the week are given with lowercase English letters: "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday".

输入输出格式

输入格式


The input consists of two lines, each of them containing the name of exactly one day of the week. It's guaranteed that each string in the input is from the set "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday".

输出格式


Print "YES" (without quotes) if such situation is possible during some non-leap year. Otherwise, print "NO" (without quotes).

输入输出样例

输入样例 #1

monday
tuesday

输出样例 #1

NO

输入样例 #2

sunday
sunday

输出样例 #2

YES

输入样例 #3

saturday
tuesday

输出样例 #3

YES

说明

In the second sample, one can consider February 1 and March 1 of year 2015. Both these days were Sundays. In the third sample, one can consider July 1 and August 1 of year 2017. First of these two days is Saturday, while the second one is Tuesday.

Input

题意翻译

**题目描述:** 您将得到一周中某两天的英文名。 请判断是否有可能在某个非闰年期间,某个月的第一天为给出的第一天,下个月的第一天为给出的第二天。这两个月应属于同一年。 本题中,我们将使用公历,即一年有12个月,每个月的天数分别为: _31,28,31,30,31,30,31,31,30,31,30,31_ 。 给出的日期名称将以小写英文单词给出,即为: _"monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"_ 。 **输入格式:** 两行。 每一行分别为一周中某一天的英文名,保证格式如题目描述中所示。 **输出格式:** 如果可能,请输出 _"YES"_ (不加引号),否则输出 _"NO"_ (不加引号)。

加入题单

上一题 下一题 算法标签: