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