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