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