package main import ( "fmt" "io" "os" ) func main() { resolve(os.Stdout, os.Stdin) } type Version struct { major, minor, patch int } func (v Version) kaseki(c Version) bool { if v.major < c.major { return true } else if v.major > c.major { return false } if v.minor < c.minor { return true } else if v.minor > c.minor { return false } if v.patch < c.patch { return true } else if v.patch > c.patch { return false } return false } func resolve(w io.Writer, r io.Reader) error { cv := Version{} _, ce := fmt.Fscanf(r, "%d.%d.%d\n", &cv.major, &cv.minor, &cv.patch) if ce != nil && ce != io.EOF { return ce } nv := Version{} _, ne := fmt.Fscanf(r, "%d.%d.%d", &nv.major, &nv.minor, &nv.patch) if ne != nil && ne != io.EOF { return ne } if cv.kaseki(nv) { fmt.Fprint(w, "NO\n") } else { fmt.Fprint(w, "YES\n") } return nil }