#include <bits/stdc++.h>
struct read_item {
  read_item(){};
  template <class T>
  operator T() {
    T t;
    std::cin >> t;
    return t;
  }
};
char splf(int i, int n) { return (i + 1 < n) ? ' ' : '\n'; };
struct RI {
  int i;
  RI(int a) : i(a) {}
  int operator*() { return i; }
  void operator++() { i += 1; }
  bool operator!=(const RI& r) { return i != r.i; }
};
struct range {
  RI x, y;
  RI begin() { return x; }
  RI end() { return y; }
  range(int a, int b) : x(a), y(b) {}
  range(int a) : x(0), y(a) {}
};
using namespace std;
int main() {
  const char* days[] = {"monday", "tuesday",  "wednesday", "thursday",
                        "friday", "saturday", "sunday"};
  string s = read_item();
  string t = read_item();
  int d1 = -1, d2 = -1;
  for (auto i : range(7)) {
    if (days[i] == s) {
      d1 = i;
    }
    if (days[i] == t) {
      d2 = i;
    }
  }
  assert(d1 >= 0 && d2 >= 0);
  int diff = d2 - d1;
  if (diff < 0) diff += 7;
  if (diff != 0 && diff != 2 && diff != 3) {
    printf("NO\n");
  } else {
    printf("YES\n");
  }
  return 0;
}
