Ok, it is true we can't search inside FIFO. But in order to find out the 2 identical entries in FIFO, we have to read out the entire content of the FIFO before we do the search. Let's say the first entry and the last entry are the identical pair we are looking for. It is obvious that we have to buffer all the entries.
If the question changes to "only 2 entries are NOT the same with the rest of the entries", then the buffer size will be much smaller (5 entry buffer should be enough).
Any better algorithm?