#include <bits/stdc++.h>
using namespace std;
int main() {
  int months[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  char d1[10];
  char d2[10];
  cin >> d1 >> d2;
  map<string, int> mapa;
  mapa["monday"] = 0;
  mapa["tuesday"] = 1;
  mapa["wednesday"] = 2;
  mapa["thursday"] = 3;
  mapa["friday"] = 4;
  mapa["saturday"] = 5;
  mapa["sunday"] = 6;
  int s1 = mapa[d1];
  int s2 = mapa[d2];
  int s3 = s1;
  int s4 = (s1 + 2) % 7;
  int s5 = (s1 + 3) % 7;
  if (s2 == s4 || s2 == s3 || s2 == s5)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
