The upper two fish (vertical stripe) are Tiger Barbs (Puntigrus tetrazona) and the four lower fish are Rosy Barbs (Pethia conchonius). Both are barbs, a group of fish in the cyprinid family.
They can be kept together, but you have to get a few more, especially of the Tiger Barb. This species is a fin nipper, and in groups less than about 8 this can be a real problem. I don't know the size of your tank, but a group of 8 should be in nothing less than a 29g (length 30 inches or 75 cm). If your tank is smaller, I would return the two Tiger Barbs as they are going to have difficulties. These fish are termed shoaling, and must be in groups to function normally or they will be stressed and problematic.