#include <bits/stdc++.h>
using namespace std;
void solution() {
  map<string, int> M;
  M["monday"] = 101;
  M["tuesday"] = 102;
  M["wednesday"] = 103;
  M["thursday"] = 104;
  M["friday"] = 105;
  M["saturday"] = 106;
  M["sunday"] = 107;
  string a, b;
  cin >> a >> b;
  int A = M[a], B = M[b];
  if (B < A) B += 7;
  if (A == B || A + 2 == B || A + 3 == B)
    cout << "YES" << '\n';
  else
    cout << "NO" << '\n';
}
int main() { solution(); }
