#include <bits/stdc++.h>
char b[20];
using namespace std;
int main() {
  char a[14];
  for (int i = 1; i <= 2; i++) {
    scanf("%s", a);
    if (strcmp(a, "monday") == 0) b[i] = 1;
    if (strcmp(a, "tuesday") == 0) b[i] = 2;
    if (strcmp(a, "wednesday") == 0) b[i] = 3;
    if (strcmp(a, "thursday") == 0) b[i] = 4;
    if (strcmp(a, "friday") == 0) b[i] = 5;
    if (strcmp(a, "saturday") == 0) b[i] = 6;
    if (strcmp(a, "sunday") == 0) b[i] = 7;
  }
  int flag = 1;
  for (int j = 3; j <= 5; j++) {
    if (j * 7 - b[1] + b[2] == 31 || j * 7 - b[1] + b[2] == 30 ||
        j * 7 - b[1] + b[2] == 28) {
      printf("YES\n");
      flag = 0;
    }
  }
  while (flag) {
    printf("NO\n");
    flag = 0;
  }
}
