#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, int> day;
  day["saturday"] = 1;
  day["sunday"] = 2;
  day["monday"] = 3;
  day["tuesday"] = 4;
  day["wednesday"] = 5;
  day["thursday"] = 6;
  day["friday"] = 7;
  string day_1, day_2;
  cin >> day_1 >> day_2;
  if (day[day_1] == day[day_2]) {
    cout << "YES" << endl;
  } else {
    int dif = day[day_2] - day[day_1];
    if (dif < 0) {
      dif += 7;
    }
    if (dif == 3 || dif == 2) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
