#include <bits/stdc++.h>
using namespace std;
int mp(string s) {
  if (s == "sunday")
    return 0;
  else if (s == "monday")
    return 1;
  else if (s == "tuesday")
    return 2;
  else if (s == "wednesday")
    return 3;
  else if (s == "thursday")
    return 4;
  else if (s == "friday")
    return 5;
  else
    return 6;
}
int main() {
  string days[7] = {"sunday",   "monday", "tuesday", "wednesday",
                    "thursday", "friday", "saturday"};
  string day1, day2;
  cin >> day1 >> day2;
  if (!day2.compare(days[(mp(day1) + 2) % 7]) ||
      !day2.compare(days[(mp(day1) + 3) % 7]) ||
      !day2.compare(days[(mp(day1) + 0) % 7])) {
    cout << "YES";
  } else
    cout << "NO";
}
