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