You can't have nested select statement like that. What needs to happen is your inner select has to be a subquery and aliased something like:
SELECT
IF(inner_table.count_column > 0, "YES", "NO) -- here we select the 'count_column' from 'inner_table
FROM
(
(SELECT count(*) as count_column FROM table1)
) as inner_table -- aliasing the inner select as 'inner_table'
Hope this makes sense. Pretty much this is how it works with bigquery, you need to construct your nested statements into subqueries. Here's some reading https://developers.google.com/bigquery/query-reference#from