#include <bits/stdc++.h>
using namespace std;
int Day_weak(int year, int month, int day) {
  if (month == 1 || month == 2) {
    month += 12;
    --year;
  }
  int week = -1;
  week = (day + 2 * month + 3 * (month + 1) / 5 + year + year / 4 - year / 100 +
          year / 400) %
             7 +
         1;
  return week;
}
map<string, int> q;
int main() {
  q["monday"] = 1;
  q["tuesday"] = 2;
  q["wednesday"] = 3;
  q["thursday"] = 4;
  q["friday"] = 5;
  q["saturday"] = 6;
  q["sunday"] = 7;
  int a, b, c;
  int i;
  string s1, s2;
  cin >> s1 >> s2;
  a = q[s1];
  b = q[s2];
  c = b - a;
  if (c <= 0) {
    c += 7;
  }
  if (c == 3 || c == 2 || c == 7) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
