#include <bits/stdc++.h>
int main() {
  char a1[20], a[20], s[8][20] = {"1234567",  "monday", "tuesday",  "wednesday",
                                  "thursday", "friday", "saturday", "sunday"};
  int i, j, j1, j2;
  gets(a);
  gets(a1);
  for (i = 1; i <= 7; i++) {
    if (strcmp(a, s[i]) == 0) {
      j = ((i + 28 % 7) + 7) % 7;
      j1 = (30 % 7 + i + 7) % 7;
      j2 = (31 % 7 + i + 7) % 7;
      if (j == 0) j = 7;
      if (j1 == 0) j1 = 7;
      if (j2 == 0) j2 = 7;
      if (strcmp(a1, s[j]) == 0 || strcmp(a1, s[j1]) == 0 ||
          strcmp(a1, s[j2]) == 0) {
        printf("YES\n");
        break;
      } else {
        printf("NO\n");
        break;
      }
      if (i == 6) {
        printf("NO\n");
        break;
      }
    }
  }
  return 0;
}
