#include <bits/stdc++.h>
using namespace std;
int min(int a, int b) {
  if (a > b)
    return b;
  else
    return a;
}
int day(string a) {
  int b;
  if (a == "monday") b = 1;
  if (a == "tuesday") b = 2;
  if (a == "wednesday") b = 3;
  if (a == "thursday") b = 4;
  if (a == "friday") b = 5;
  if (a == "saturday") b = 6;
  if (a == "sunday") b = 7;
  return b;
}
int main(int argc, char** argv) {
  string s1, s2;
  cin >> s1;
  cin >> s2;
  int a1, a2, dif;
  a1 = day(s1);
  a2 = day(s2);
  if (a2 - a1 < 0)
    dif = a2 - a1 + 7;
  else
    dif = a2 - a1;
  if (dif == 0 or dif == 2 or dif == 3)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
