diff --git a/lib/ansible/plugins/inventory/yaml.py b/lib/ansible/plugins/inventory/yaml.py
index ae964aa1d71..062f7a235e3 100644
--- a/lib/ansible/plugins/inventory/yaml.py
+++ b/lib/ansible/plugins/inventory/yaml.py
@@ -74,7 +74,7 @@ class InventoryModule(BaseFileInventoryPlugin):
         valid = False
         if super(InventoryModule, self).verify_file(path):
             file_name, ext = os.path.splitext(path)
-            if ext and ext in C.YAML_FILENAME_EXTENSIONS:
+            if not ext or ext in C.YAML_FILENAME_EXTENSIONS:
                 valid = True
         return valid