#include <bits/stdc++.h>
using namespace std;
vector<string> day({"monday", "tuesday", "wednesday", "thursday", "friday",
                    "saturday", "sunday", "monday", "tuesday", "wednesday",
                    "thursday", "friday", "saturday", "sunday"});
int main() {
  string d1, d2;
  cin >> d1 >> d2;
  int i = 0;
  while (day[i] != d1) i++;
  int p = 0;
  while (day[i + p] != d2) p++;
  if (p == 0 || p == 2 || p == 3)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
