I
Most probably you can... I just checked on iOS 12 and it does have an option to add a Yahoo account in the Settings App. Give it a try, I don't have an iPhone 4 to check myself.
Welcome to iMore
Unfortunately the i4 is only supposed till iOS 7.1.2
Enjoy and Post Often
My old 4s still runs a Yahoo email account perfectly well, 7.1.2 runs fine if slowly, I know, I just looked !!