#include <bits/stdc++.h>
using namespace std;
const int maxn = 300003, maxlog = 21;
int n, Q, a[maxn], last[maxlog], dp[maxn][maxlog];
int main() {
  scanf("%d%d", &n, &Q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
    for (int j = 0; j < maxlog; j++) {
      if ((a[i] >> j) & 1) {
        dp[i][j] = i;
        for (int k = 0; k < maxlog; k++) {
          dp[i][k] = max(dp[i][k], dp[last[j]][k]);
        }
        last[j] = i;
      }
    }
  }
  while (Q--) {
    int x, y, flag = 0;
    scanf("%d%d", &x, &y);
    for (int i = 0; i < maxlog; i++) {
      if (((a[x] >> i) & 1) && dp[y][i] >= x) {
        flag = 1;
        break;
      }
    }
    puts(flag ? "Shi" : "Fou");
  }
  return 0;
}
