#include <bits/stdc++.h>
using namespace std;
string d1, d2;
vector<string> day;
map<string, int> days;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  day = {"monday", "tuesday",  "wednesday", "thursday",
         "friday", "saturday", "sunday"};
  for (int i = 0; i < 7; i++) {
    days[day[i]] = i + 1;
  }
  cin >> d1 >> d2;
  int d = days[d2] - days[d1];
  d += 7;
  d %= 7;
  if (d == 0 || d == 2 || d == 3) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
