diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -11,6 +11,10 @@
     y = 2 ** a[i]
 
     m = len(l)
+
+    if m == 0:
+        ans = "No"
+
     for j in range(m):
         s = l[j][0]
         t = l[j][1]
