#include <bits/stdc++.h>
using namespace std;
int numday(string s) {
  if (s == "monday") return 1;
  if (s == "tuesday") return 2;
  if (s == "wednesday") return 3;
  if (s == "thursday") return 4;
  if (s == "friday") return 5;
  if (s == "saturday") return 6;
  return 0;
}
int main() {
  string s, t;
  cin >> s >> t;
  int a = numday(s);
  int b = numday(t);
  int c = (b + 7 - a) % 7;
  if (c == 0 || c == 2 || c == 3) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
