#include <bits/stdc++.h>
char conv_to_num(char x[]) {
  if (!strcmp(x, "monday"))
    return 1;
  else if (!strcmp(x, "tuesday"))
    return 2;
  else if (!strcmp(x, "wednesday"))
    return 3;
  else if (!strcmp(x, "thursday"))
    return 4;
  else if (!strcmp(x, "friday"))
    return 5;
  else if (!strcmp(x, "saturday"))
    return 6;
  else
    return 7;
}
int main() {
  char d1[20], d2[20], t1, t2, f, diff;
  gets(d1);
  gets(d2);
  t1 = conv_to_num(d1);
  t2 = conv_to_num(d2);
  if (t1 == t2)
    f = 1;
  else {
    if (t1 < t2)
      diff = (t2 - t1) - 1;
    else
      diff = (t2 + 7) - t1 - 1;
    if (diff == 1 || diff == 2)
      f = 1;
    else
      f = 0;
  }
  if (f)
    printf("Yes");
  else {
    printf("No");
  }
  return 0;
}
