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