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