Can Hazel do this ? How?

Corlin here:
Here is what I would like to do in more detail.
I have a huge store of old text files. In many different formats. Many of which are duplicates with the only difference being the extension.
1. I want to keep all the files that have extension ".yyy"
2. If two or more files have exactly the same name, and none have extension ".yyy" keep the one that has extension ".zzz"
3. Move the rest to a folder to be checked before trashing.
So how do I make this rule?
Here is what I would like to do in more detail.
I have a huge store of old text files. In many different formats. Many of which are duplicates with the only difference being the extension.
1. I want to keep all the files that have extension ".yyy"
2. If two or more files have exactly the same name, and none have extension ".yyy" keep the one that has extension ".zzz"
3. Move the rest to a folder to be checked before trashing.
So how do I make this rule?