#include <bits/stdc++.h>
using namespace std;
string week[8] = {"monday", "tuesday",  "wednesday", "thursday",
                  "friday", "saturday", "sunday"};
string day1, day2;
int num1, num2;
int main() {
  cin >> day1 >> day2;
  for (int i = 0; i <= 6; i++) {
    if (week[i] == day1) num1 = i;
    if (week[i] == day2) num2 = i;
  }
  if ((num1 + 31) % 7 == num2 || (num1 + 30) % 7 == num2 ||
      (num1 + 28) % 7 == num2)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
