#include <bits/stdc++.h>
int main() {
  std::string day1, day2;
  std::cin >> day1 >> day2;
  int nDay1, nDay2;
  if (day1 == "monday") {
    nDay1 = 1;
  } else if (day1 == "tuesday") {
    nDay1 = 2;
  } else if (day1 == "wednesday") {
    nDay1 = 3;
  } else if (day1 == "thursday") {
    nDay1 = 4;
  } else if (day1 == "friday") {
    nDay1 = 5;
  } else if (day1 == "saturday") {
    nDay1 = 6;
  } else if (day1 == "sunday") {
    nDay1 = 7;
  }
  if (day2 == "monday") {
    nDay2 = 1;
  } else if (day2 == "tuesday") {
    nDay2 = 2;
  } else if (day2 == "wednesday") {
    nDay2 = 3;
  } else if (day2 == "thursday") {
    nDay2 = 4;
  } else if (day2 == "friday") {
    nDay2 = 5;
  } else if (day2 == "saturday") {
    nDay2 = 6;
  } else if (day2 == "sunday") {
    nDay2 = 7;
  }
  if (nDay1 == nDay2 || (nDay2 + 7 - nDay1) % 7 == 3 ||
      (nDay2 + 7 - nDay1) % 7 == 2) {
    std::cout << "YES";
  } else {
    std::cout << "NO";
  }
  return 0;
}
