#include <bits/stdc++.h>
using namespace std;
inline bool isEq(double a, double b) { return (abs(a - b) < 1e-9); }
inline int negModHandler(int a, int d) {
  return ((a % d) < 0) ? d + (a % d) : (a % d);
}
int main() {
  string ara[] = {"monday", "tuesday",  "wednesday", "thursday",
                  "friday", "saturday", "sunday"};
  map<string, int> mmm;
  for (int i = 0; i < 7; i++) {
    mmm[ara[i]] = i;
  }
  string day1, day2;
  cin >> day1 >> day2;
  int months[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  bool f = false;
  for (int i = 0; i < 11; i++) {
    int dd = mmm[day1] + months[i];
    if (ara[dd % 7] == day2) {
      f = true;
      break;
    }
  }
  if (f)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
