#include <bits/stdc++.h>
int change(char a[]) {
  if (a[0] == 'm')
    return 0;
  else if (a[0] == 't') {
    if (a[1] == 'u')
      return 1;
    else
      return 3;
  } else if (a[0] == 'w')
    return 2;
  else if (a[0] == 'f')
    return 4;
  else if (a[0] == 's') {
    if (a[1] == 'a')
      return 5;
    else
      return 6;
  }
}
int main() {
  char a[10];
  char b[10];
  gets(a);
  gets(b);
  int num;
  int tem;
  tem = change(a);
  num = change(b);
  if ((28 - 7 + tem) % 7 == num)
    printf("YES");
  else if ((30 - 7 + tem) % 7 == num)
    printf("YES");
  else if ((31 - 7 + tem) % 7 == num)
    printf("YES");
  else
    printf("NO");
  return 0;
}
