The function replaces all occurrences of the letter 'a' or 'A' in the input string with the capital letter 'Y'.

[CODE]: 
```python
def f(x):
    return x.replace('a', 'Y').replace('A', 'Y')
```