#include <bits/stdc++.h>
using namespace std;
int weekday(string s) {
  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 if (s == "saturday") {
    return 6;
  } else {
    return 7;
  }
}
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  int d1 = weekday(s1);
  int d2 = weekday(s2);
  int counter = 0;
  if (d1 <= d2) {
    counter = d2 - d1;
  } else {
    counter = 7 + d2 - d1;
  }
  if (counter == 0 || counter == 2 || counter == 3) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
