1. First bed file to overlap
2. Second bed file for overlap
3. Bed file that will serve as genomic background for overlaps.
As genomic background you can use e.g. combined ENCODE set of open chromatin regions or a similar data set. Genomic background is necessary to calculate the constituents of the Fisher test contingency matrix: overlap of A and B in the background BG set, A but not B in BG, B but not A in BG, BG without A and B.