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