[SOLVED] Is there any easy way to find if a number exists in a list?

inspired by CosmicGold - what about using bitmasks?

int inMenu(int men, int p)
{
  p = (1 << p);
  switch(men)
  {
    case 7: return p & 0xFC;
    case 8: return p & 0x0C; 
    case 9: return p & 0x0C; 
    case 10: return p & 0xFC;
    case 11: return p & 0x9C;
  }
  return 0;
}

update:
it could even be an array of bytes and one formula,
however relation with original problem is a bit lost.

int inMenu(const int men, const int p)
{
  byte masks[] = { 0,0,0,0,0,0,0,0xFC, 0x0C,0x0C, 0xFC, 0x9C, };
  return masks[men] & (1<<p);
}