#include <bits/stdc++.h>
using namespace std;
using namespace std;
vector<string> v = {"monday", "tuesday",  "wednesday", "thursday",
                    "friday", "saturday", "sunday"};
int main() {
  string s, t;
  cin >> s >> t;
  for (int i = 0; i < v.size(); i++) {
    if (s == v[i]) {
      if (t == s || t == v[(i + 2) % v.size()] || t == v[(i + 3) % v.size()]) {
        cout << "YES";
      } else {
        cout << "NO";
      }
    }
  }
}
