#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  string n;
  cin >> s;
  cin >> n;
  string day[15];
  day[0] = "monday";
  day[1] = "tuesday";
  day[2] = "wednesday";
  day[3] = "thursday";
  day[4] = "friday";
  day[5] = "saturday";
  day[6] = "sunday";
  day[7] = "monday";
  day[8] = "tuesday";
  day[9] = "wednesday";
  day[10] = "thursday";
  day[11] = "friday";
  day[12] = "saturday";
  day[13] = "sunday";
  int x, y;
  for (int i = 0; i < 7; i++) {
    if (day[i] == s) {
      x = i;
      break;
    }
  }
  if (day[x + 2] == n || day[x] == n || day[x + 3] == n)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
