#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void umax(T &a, T b) {
  if (a < b) a = b;
}
template <class T>
inline void umin(T &a, T b) {
  if (a > b) a = b;
}
template <class T>
inline T abs(T a) {
  return a > 0 ? a : -a;
}
const int inf = 1e9 + 143;
const long long longinf = 1e18 + 143;
inline int read() {
  int x;
  scanf(" %d", &x);
  return x;
}
const int MAX = 2000 * 366;
string days[7] = {"monday", "tuesday",  "wednesday", "thursday",
                  "friday", "saturday", "sunday"};
int months[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
bool nonleap(int x) {
  if (x % 4) {
    return true;
  } else if (x % 100) {
    return false;
  } else if (x % 400) {
    return true;
  } else {
    return false;
  }
}
int main() {
  string sa, sb;
  cin >> sa >> sb;
  int a, b;
  for (int i = 0; i < 7; i++) {
    if (sa == days[i]) {
      a = i;
    }
    if (sb == days[i]) {
      b = i;
    }
  }
  int cday = 6;
  int cyear = 2015;
  int cmonth = 1;
  for (int it = 0; it < MAX; it++) {
    int nday = (cday + months[cmonth]) % 7;
    if (nonleap(cyear) && cday == a && nday == b) {
      puts("YES");
      return 0;
    }
    cday = nday;
    cmonth++;
    if (cmonth == 12) {
      cmonth = 0;
      cyear++;
    }
  }
  puts("NO");
  return 0;
}
