#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e2 + 10;
const long long INF = 1e16;
const int MOD = 1e9 + 7;
string s[] = {"monday", "tuesday",  "wednesday", "thursday",
              "friday", "saturday", "sunday"};
int a[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int b[100][12];
int main() {
  ios_base::sync_with_stdio(false);
  string aa, bb;
  b[0][0] = 6;
  for (int i = 1; i < 12; i++) b[0][i] = (b[0][i - 1] + a[i - 1]) % 7;
  for (int i = 1; i < 100; i++) {
    b[i][0] = (b[i - 1][11] + a[11]) % 7;
    for (int j = 1; j < 12; j++) b[i][j] = (b[i][j - 1] + a[j - 1]) % 7;
  }
  int ind1, ind2;
  cin >> aa >> bb;
  for (int i = 0; i < 7; i++) {
    if (s[i] == aa) ind1 = i;
    if (s[i] == bb) ind2 = i;
  }
  for (int i = 0; i < 100; i++) {
    for (int j = 0; j < 11; j++) {
      if (b[i][j] == ind1 && b[i][j + 1] == ind2) {
        cout << "YES";
        return 0;
      }
    }
  }
  cout << "NO";
}
