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