The length of the fence is its area divided by its height:
fence length = (500 ft²)/(5 ft) = 100 ft
Since the yard is square, it has 4 equal-length sides. Each side of the yard is bounded by 1/4 of the total fence length, or 25 ft.
The area of the yard is the square of its side length, (25 ft)² = 625 ft².