#include <bits/stdc++.h>
using namespace std;
string s, d;
int main() {
  cin >> s >> d;
  if (s == "monday") {
    if (d == "wednesday" || d == s || d == "thursday")
      cout << "YES";
    else
      cout << "NO";
  } else if (s == "tuesday") {
    if (d == "friday" || d == s || d == "thursday")
      cout << "YES";
    else
      cout << "NO";
  } else if (s == "wednesday") {
    if (d == "friday" || d == s || d == "saturday")
      cout << "YES";
    else
      cout << "NO";
  } else if (s == "thursday") {
    if (d == "saturday" || d == s || d == "sunday")
      cout << "YES";
    else
      cout << "NO";
  } else if (s == "friday") {
    if (d == "sunday" || d == s || d == "monday")
      cout << "YES";
    else
      cout << "NO";
  } else if (s == "saturday") {
    if (d == "monday" || d == s || d == "tuesday")
      cout << "YES";
    else
      cout << "NO";
  } else if (s == "sunday") {
    if (d == "wednesday" || d == s || d == "tuesday")
      cout << "YES";
    else
      cout << "NO";
  }
  return 0;
}
