------
## 最终结论
```python
def find_first_duplicate(arr):
    seen = set()
    for num in arr:
        if num in seen:
            return num
        seen.add(num)
    return -1

# Test cases
assert find_first_duplicate([1, 2, 3, 4, 4, 5]) == 4
assert find_first_duplicate([1, 2, 3, 4]) == -1
assert find_first_duplicate([1, 1, 2, 3, 3, 2, 2]) == 1
```