#include <bits/stdc++.h>
using namespace std;
string a[11] = {"monday", "tuesday",  "wednesday", "thursday",
                "friday", "saturday", "sunday"};
int main() {
  string s;
  cin >> s;
  string t;
  cin >> t;
  int q, w;
  for (int i = 0; i < 8; i++) {
    if (s == a[i]) {
      q = i;
    }
    if (t == a[i]) {
      w = i;
    }
  }
  if ((q + 31) % 7 == w || (q + 30) % 7 == w || (q + 28) % 7 == w) {
    cout << "YES";
  } else
    cout << "NO";
  return 0;
}
