Why you set every time same variable on YES? Could you set it once before/after for loop.