#include <bits/stdc++.h>
using namespace std;
int cnt[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
string a, b;
string days[] = {"monday", "tuesday",  "wednesday", "thursday",
                 "friday", "saturday", "sunday"};
int main() {
  cin >> a >> b;
  int idxA = find(days, days + 7, a) - days;
  for (int j = 0; j < 11; j++) {
    if (days[(idxA + cnt[j]) % 7] == b) {
      puts("YES");
      return 0;
    }
  }
  puts("NO");
  return 0;
}
