#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, int> m;
  map<int, string> m1;
  m["monday"] = 0;
  m["tuesday"] = 1;
  m["wednesday"] = 2;
  m["thursday"] = 3;
  m["friday"] = 4;
  m["saturday"] = 5;
  m["sunday"] = 6;
  m1[0] = "monday";
  m1[1] = "tuesday";
  m1[2] = "wednesday";
  m1[3] = "thursday";
  m1[4] = "friday";
  m1[5] = "saturday";
  m1[6] = "sunday";
  string s, s2;
  while (cin >> s >> s2) {
    int t = m[s];
    if (m1[(t + 0) % 7] == s2 || m1[(t + 2) % 7] == s2 || m1[(t + 3) % 7] == s2)
      cout << "YES"
           << "\n";
    else
      cout << "NO"
           << "\n";
  }
}
