x Stands for the last cell with data in Column "A"

  
x = Range("A" & Rows.Count).End(3).row
(3) is a short form for xlup - Means the same (3) or (xlUp)

When you sort the column "A" descending Alphabetically the YES's will be on Top and then the "NO's".

Did you test the code too see if it does what you want?