diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -18,7 +18,7 @@
 
     for i in range(1, n):
         ss = s[i]
-        if s0 < ss or (s0 == ss and s0 < "".join(s[i:])):
+        if s0 < ss or (s0 == ss and "".join(s[:i]) < "".join(s[i:])):
             print("Yes")
             break
     else:
