#include <bits/stdc++.h>
using namespace std;
const int INF = 100000;
const int mod = 1000000007;
const long long LINF = 2000000100000000000LL;
char day[10][10] = {"monday", "tuesday",  "wednesday", "thursday",
                    "friday", "saturday", "sunday"};
int date[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main() {
  char s1[10], s2[10];
  int d1, d2;
  scanf("%s%s", s1, s2);
  for (int i = 0; i < 7; i++) {
    if (strcmp(s1, day[i]) == 0) d1 = i;
    if (strcmp(s2, day[i]) == 0) d2 = i;
  }
  for (int i = 1; i < 12; i++) {
    if ((d1 + date[i]) % 7 == d2) {
      printf("YES\n");
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}
