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