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