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