#include <bits/stdc++.h>
using namespace std;
char st[8][20] = {"err",      "monday", "tuesday",  "wednesday",
                  "thursday", "friday", "saturday", "sunday"};
int main() {
  char s1[20], s2[20];
  scanf(" %s %s", s1, s2);
  int t1 = 0, t2 = 0;
  for (int i = 1; i <= 7; i++)
    if (strcmp(s1, st[i]) == 0) {
      t1 = i;
      break;
    }
  for (int i = 1; i <= 7; i++)
    if (strcmp(s2, st[i]) == 0) {
      t2 = i;
      break;
    }
  bool flag = false;
  if (t1 == t2) flag = true;
  int tmp = t1 + 2;
  if (tmp > 7) tmp -= 7;
  if (tmp == t2) flag = true;
  tmp = t1 + 3;
  if (tmp > 7) tmp -= 7;
  if (tmp == t2) flag = true;
  puts(flag ? "YES" : "NO");
  return 0;
}
